]> Dogcows Code - chaz/tint2/blob - src/systray/systraybar.c
tint2conf : cleanup
[chaz/tint2] / src / systray / systraybar.c
1 /**************************************************************************
2 * Tint2 : systraybar
3 *
4 * Copyright (C) 2009 thierry lorthiois (lorthiois@bbsoft.fr)
5 * based on 'docker-1.5' from Ben Jansens.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version 2
9 * as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 **************************************************************************/
19
20 #include <X11/Xlib.h>
21 #include <X11/Xutil.h>
22 #include <X11/Xatom.h>
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
26 #include <glib.h>
27 #include <Imlib2.h>
28 #include <X11/extensions/Xdamage.h>
29 #include <X11/extensions/Xcomposite.h>
30 #include <X11/extensions/Xrender.h>
31
32
33 #include "systraybar.h"
34 #include "server.h"
35 #include "panel.h"
36
37 GSList *icons;
38
39 /* defined in the systray spec */
40 #define SYSTEM_TRAY_REQUEST_DOCK 0
41 #define SYSTEM_TRAY_BEGIN_MESSAGE 1
42 #define SYSTEM_TRAY_CANCEL_MESSAGE 2
43
44 // selection window
45 Window net_sel_win = None;
46
47 // freedesktop specification doesn't allow multi systray
48 Systraybar systray;
49 int refresh_systray;
50 int systray_enabled;
51 int systray_max_icon_size = 0;
52
53 // background pixmap if we render ourselves the icons
54 static Pixmap render_background = 0;
55
56
57 void init_systray()
58 {
59 start_net();
60
61 if (!systray_enabled)
62 return;
63
64 if (!server.visual32 && (systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0)) {
65 printf("No 32 bit visual for your X implementation. 'systray_asb = 100 0 0' will be forced\n");
66 systray.alpha = 100;
67 systray.brightness = systray.saturation = 0;
68 }
69 systray.area._draw_foreground = draw_systray;
70 systray.area._resize = resize_systray;
71 systray.area.resize = 1;
72 systray.area.redraw = 1;
73 systray.area.on_screen = 1;
74 refresh_systray = 0;
75 }
76
77
78 void init_systray_panel(void *p)
79 {
80 Panel *panel =(Panel*)p;
81
82 if (panel_horizontal) {
83 systray.area.posy = panel->area.bg->border.width + panel->area.paddingy;
84 systray.area.height = panel->area.height - (2 * systray.area.posy);
85 }
86 else {
87 systray.area.posx = panel->area.bg->border.width + panel->area.paddingy;
88 systray.area.width = panel->area.width - (2 * panel->area.bg->border.width) - (2 * panel->area.paddingy);
89 }
90 systray.area.parent = p;
91 systray.area.panel = p;
92 }
93
94
95 void cleanup_systray()
96 {
97 systray_enabled = 0;
98 systray.area.on_screen = 0;
99 free_area(&systray.area);
100 if (render_background) XFreePixmap(server.dsp, render_background);
101 }
102
103
104 void draw_systray(void *obj, cairo_t *c)
105 {
106 if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
107 if (render_background) XFreePixmap(server.dsp, render_background);
108 render_background = XCreatePixmap(server.dsp, server.root_win, systray.area.width, systray.area.height, server.depth);
109 XCopyArea(server.dsp, systray.area.pix, render_background, server.gc, 0, 0, systray.area.width, systray.area.height, 0, 0);
110 }
111
112 refresh_systray = 1;
113 }
114
115
116 void resize_systray(void *obj)
117 {
118 Systraybar *sysbar = obj;
119 Panel *panel = sysbar->area.panel;
120 TrayWindow *traywin;
121 GSList *l;
122 int count, icon_size;
123 int icons_per_column=1, icons_per_row=1, marging=0;
124
125 if (panel_horizontal)
126 icon_size = sysbar->area.height;
127 else
128 icon_size = sysbar->area.width;
129 icon_size = icon_size - (2 * sysbar->area.bg->border.width) - (2 * sysbar->area.paddingy);
130 if (systray_max_icon_size > 0 && icon_size > systray_max_icon_size)
131 icon_size = systray_max_icon_size;
132 count = 0;
133 for (l = systray.list_icons; l ; l = l->next) {
134 if (!((TrayWindow*)l->data)->hide)
135 count++;
136 }
137 //printf("count %d\n", count);
138
139 if (panel_horizontal) {
140 if (!count) systray.area.width = 0;
141 else {
142 int height = sysbar->area.height - 2*sysbar->area.bg->border.width - 2*sysbar->area.paddingy;
143 // here icons_per_column always higher than 0
144 icons_per_column = (height+sysbar->area.paddingx) / (icon_size+sysbar->area.paddingx);
145 marging = height - (icons_per_column-1)*(icon_size+sysbar->area.paddingx) - icon_size;
146 icons_per_row = count / icons_per_column + (count%icons_per_column != 0);
147 systray.area.width = (2 * systray.area.bg->border.width) + (2 * systray.area.paddingxlr) + (icon_size * icons_per_row) + ((icons_per_row-1) * systray.area.paddingx);
148 }
149
150 systray.area.posx = panel->area.width - panel->area.bg->border.width - panel->area.paddingxlr - systray.area.width;
151 if (panel->clock.area.on_screen)
152 systray.area.posx -= (panel->clock.area.width + panel->area.paddingx);
153 #ifdef ENABLE_BATTERY
154 if (panel->battery.area.on_screen)
155 systray.area.posx -= (panel->battery.area.width + panel->area.paddingx);
156 #endif
157 }
158 else {
159 if (!count) systray.area.height = 0;
160 else {
161 int width = sysbar->area.width - 2*sysbar->area.bg->border.width - 2*sysbar->area.paddingy;
162 // here icons_per_row always higher than 0
163 icons_per_row = (width+sysbar->area.paddingx) / (icon_size+sysbar->area.paddingx);
164 marging = width - (icons_per_row-1)*(icon_size+sysbar->area.paddingx) - icon_size;
165 icons_per_column = count / icons_per_row+ (count%icons_per_row != 0);
166 systray.area.height = (2 * systray.area.bg->border.width) + (2 * systray.area.paddingxlr) + (icon_size * icons_per_column) + ((icons_per_column-1) * systray.area.paddingx);
167 }
168
169 systray.area.posy = panel->area.bg->border.width + panel->area.paddingxlr;
170 if (panel->clock.area.on_screen)
171 systray.area.posy += (panel->clock.area.height + panel->area.paddingx);
172 #ifdef ENABLE_BATTERY
173 if (panel->battery.area.on_screen)
174 systray.area.posy += (panel->battery.area.height + panel->area.paddingx);
175 #endif
176 }
177
178 int i, posx, posy;
179 int start = panel->area.bg->border.width + panel->area.paddingy + systray.area.bg->border.width + systray.area.paddingy +marging/2;
180 if (panel_horizontal) {
181 posy = start;
182 posx = systray.area.posx + systray.area.bg->border.width + systray.area.paddingxlr;
183 }
184 else {
185 posx = start;
186 posy = systray.area.posy + systray.area.bg->border.width + systray.area.paddingxlr;
187 }
188
189 for (i=1, l = systray.list_icons; l ; i++, l = l->next) {
190 traywin = (TrayWindow*)l->data;
191 if (traywin->hide) continue;
192
193 traywin->y = posy;
194 traywin->x = posx;
195 traywin->width = icon_size;
196 traywin->height = icon_size;
197 if (panel_horizontal) {
198 if (i % icons_per_column)
199 posy += icon_size + sysbar->area.paddingx;
200 else {
201 posy = start;
202 posx += (icon_size + systray.area.paddingx);
203 }
204 }
205 else {
206 if (i % icons_per_row)
207 posx += icon_size + systray.area.paddingx;
208 else {
209 posx = start;
210 posy += (icon_size + systray.area.paddingx);
211 }
212 }
213
214 // position and size the icon window
215 XMoveResizeWindow(server.dsp, traywin->id, traywin->x, traywin->y, icon_size, icon_size);
216 XResizeWindow(server.dsp, traywin->tray_id, icon_size, icon_size);
217 }
218 // resize force the redraw
219 systray.area.redraw = 1;
220 }
221
222
223 // ***********************************************
224 // systray protocol
225
226 void start_net()
227 {
228 if (net_sel_win) {
229 // protocol already started
230 if (!systray_enabled)
231 stop_net();
232 return;
233 }
234 else
235 if (!systray_enabled)
236 return;
237
238 Window win = XGetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN);
239
240 // freedesktop systray specification
241 if (win != None) {
242 // search pid
243 Atom _NET_WM_PID, actual_type;
244 int actual_format;
245 unsigned long nitems;
246 unsigned long bytes_after;
247 unsigned char *prop = 0;
248 int pid;
249
250 _NET_WM_PID = XInternAtom(server.dsp, "_NET_WM_PID", True);
251 int ret = XGetWindowProperty(server.dsp, win, _NET_WM_PID, 0, 1024, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop);
252
253 fprintf(stderr, "tint2 : another systray is running");
254 if (ret == Success && prop) {
255 pid = prop[1] * 256;
256 pid += prop[0];
257 fprintf(stderr, " pid=%d", pid);
258 }
259 fprintf(stderr, "\n");
260 return;
261 }
262
263 // init systray protocol
264 net_sel_win = XCreateSimpleWindow(server.dsp, server.root_win, -1, -1, 1, 1, 0, 0, 0);
265
266 // v0.3 trayer specification. tint2 always horizontal.
267 // Vertical panel will draw the systray horizontal.
268 int orient = 0;
269 XChangeProperty(server.dsp, net_sel_win, server.atom._NET_SYSTEM_TRAY_ORIENTATION, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &orient, 1);
270 VisualID vid;
271 if (server.visual32 && (systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0))
272 vid = XVisualIDFromVisual(server.visual32);
273 else
274 vid = XVisualIDFromVisual(server.visual);
275 XChangeProperty(server.dsp, net_sel_win, XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_VISUAL", False), XA_VISUALID, 32, PropModeReplace, (unsigned char*)&vid, 1);
276
277 XSetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN, net_sel_win, CurrentTime);
278 if (XGetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN) != net_sel_win) {
279 stop_net();
280 fprintf(stderr, "tint2 : can't get systray manager\n");
281 return;
282 }
283
284 //fprintf(stderr, "tint2 : systray started\n");
285 XClientMessageEvent ev;
286 ev.type = ClientMessage;
287 ev.window = server.root_win;
288 ev.message_type = server.atom.MANAGER;
289 ev.format = 32;
290 ev.data.l[0] = CurrentTime;
291 ev.data.l[1] = server.atom._NET_SYSTEM_TRAY_SCREEN;
292 ev.data.l[2] = net_sel_win;
293 ev.data.l[3] = 0;
294 ev.data.l[4] = 0;
295 XSendEvent(server.dsp, server.root_win, False, StructureNotifyMask, (XEvent*)&ev);
296 }
297
298
299 void stop_net()
300 {
301 //fprintf(stderr, "tint2 : systray stopped\n");
302 if (systray.list_icons) {
303 // remove_icon change systray.list_icons
304 while(systray.list_icons)
305 remove_icon((TrayWindow*)systray.list_icons->data);
306
307 g_slist_free(systray.list_icons);
308 systray.list_icons = 0;
309 }
310
311 if (net_sel_win != None) {
312 XDestroyWindow(server.dsp, net_sel_win);
313 net_sel_win = None;
314 }
315 }
316
317
318 gboolean error;
319 int window_error_handler(Display *d, XErrorEvent *e)
320 {
321 d=d;e=e;
322 error = TRUE;
323 if (e->error_code != BadWindow) {
324 printf("error_handler %d\n", e->error_code);
325 }
326 return 0;
327 }
328
329
330 static gint compare_traywindows(gconstpointer a, gconstpointer b)
331 {
332 const TrayWindow * traywin_a = (TrayWindow*)a;
333 const TrayWindow * traywin_b = (TrayWindow*)b;
334 XTextProperty name_a, name_b;
335
336 if(XGetWMName(server.dsp, traywin_a->tray_id, &name_a) == 0) {
337 return -1;
338 }
339 else if(XGetWMName(server.dsp, traywin_b->tray_id, &name_b) == 0) {
340 XFree(name_a.value);
341 return 1;
342 }
343 else {
344 gint retval = g_ascii_strncasecmp((char*)name_a.value, (char*)name_b.value, -1) * systray.sort;
345 XFree(name_a.value);
346 XFree(name_b.value);
347 return retval;
348 }
349 }
350
351
352 gboolean add_icon(Window id)
353 {
354 TrayWindow *traywin;
355 XErrorHandler old;
356 Panel *panel = systray.area.panel;
357 int hide = 0;
358
359 error = FALSE;
360 XWindowAttributes attr;
361 if ( XGetWindowAttributes(server.dsp, id, &attr) == False ) return FALSE;
362 unsigned long mask = 0;
363 XSetWindowAttributes set_attr;
364 printf("icon with depth: %d\n", attr.depth);
365 if (attr.depth != server.depth || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
366 set_attr.colormap = attr.colormap;
367 set_attr.background_pixel = 0;
368 set_attr.border_pixel = 0;
369 mask = CWColormap|CWBackPixel|CWBorderPixel;
370 }
371 else {
372 set_attr.background_pixmap = ParentRelative;
373 mask = CWBackPixmap;
374 }
375 Window parent_window;
376 parent_window = XCreateWindow(server.dsp, panel->main_win, 0, 0, 30, 30, 0, attr.depth, InputOutput, attr.visual, mask, &set_attr);
377 old = XSetErrorHandler(window_error_handler);
378 XReparentWindow(server.dsp, id, parent_window, 0, 0);
379 XSync(server.dsp, False);
380 XSetErrorHandler(old);
381 if (error != FALSE) {
382 fprintf(stderr, "tint2 : not icon_swallow\n");
383 XDestroyWindow(server.dsp, parent_window);
384 return FALSE;
385 }
386
387 {
388 Atom acttype;
389 int actfmt;
390 unsigned long nbitem, bytes;
391 unsigned char *data = 0;
392 int ret;
393
394 ret = XGetWindowProperty(server.dsp, id, server.atom._XEMBED_INFO, 0, 2, False, server.atom._XEMBED_INFO, &acttype, &actfmt, &nbitem, &bytes, &data);
395 if (ret == Success) {
396 if (data) {
397 if (nbitem == 2) {
398 //hide = ((data[1] & XEMBED_MAPPED) == 0);
399 //printf("hide %d\n", hide);
400 }
401 XFree(data);
402 }
403 }
404 else {
405 fprintf(stderr, "tint2 : xembed error\n");
406 XDestroyWindow(server.dsp, parent_window);
407 return FALSE;
408 }
409 }
410 {
411 XEvent e;
412 e.xclient.type = ClientMessage;
413 e.xclient.serial = 0;
414 e.xclient.send_event = True;
415 e.xclient.message_type = server.atom._XEMBED;
416 e.xclient.window = id;
417 e.xclient.format = 32;
418 e.xclient.data.l[0] = CurrentTime;
419 e.xclient.data.l[1] = XEMBED_EMBEDDED_NOTIFY;
420 e.xclient.data.l[2] = 0;
421 e.xclient.data.l[3] = parent_window;
422 e.xclient.data.l[4] = 0;
423 XSendEvent(server.dsp, id, False, 0xFFFFFF, &e);
424 }
425
426 printf("Adding systray with window: %d\n", id);
427 traywin = g_new0(TrayWindow, 1);
428 traywin->id = parent_window;
429 traywin->tray_id = id;
430 traywin->hide = hide;
431 traywin->depth = attr.depth;
432 traywin->damage = 0;
433
434 if (systray.sort == 3)
435 systray.list_icons = g_slist_prepend(systray.list_icons, traywin);
436 else if (systray.sort == 2)
437 systray.list_icons = g_slist_append(systray.list_icons, traywin);
438 else
439 systray.list_icons = g_slist_insert_sorted(systray.list_icons, traywin, compare_traywindows);
440 systray.area.resize = 1;
441 //printf("add_icon id %lx, %d\n", id, g_slist_length(systray.list_icons));
442
443 // watch for the icon trying to resize itself!
444 XSelectInput(server.dsp, traywin->tray_id, StructureNotifyMask);
445 if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
446 traywin->damage = XDamageCreate(server.dsp, traywin->id, XDamageReportRawRectangles);
447 XCompositeRedirectWindow(server.dsp, traywin->id, CompositeRedirectManual);
448 }
449
450 // show the window
451 if (!traywin->hide)
452 XMapWindow(server.dsp, traywin->tray_id);
453 if (!traywin->hide && !panel->is_hidden)
454 XMapRaised(server.dsp, traywin->id);
455
456 // changed in systray force resize on panel
457 panel->area.resize = 1;
458 panel_refresh = 1;
459 return TRUE;
460 }
461
462
463 void remove_icon(TrayWindow *traywin)
464 {
465 XErrorHandler old;
466
467 printf("Removing systray with window: %d\n", traywin->tray_id);
468 // remove from our list
469 systray.list_icons = g_slist_remove(systray.list_icons, traywin);
470 systray.area.resize = 1;
471 //printf("remove_icon id %lx, %d\n", traywin->id);
472
473 XSelectInput(server.dsp, traywin->tray_id, NoEventMask);
474 if (traywin->damage)
475 XDamageDestroy(server.dsp, traywin->damage);
476
477 // reparent to root
478 error = FALSE;
479 old = XSetErrorHandler(window_error_handler);
480 if (!traywin->hide)
481 XUnmapWindow(server.dsp, traywin->tray_id);
482 XReparentWindow(server.dsp, traywin->tray_id, server.root_win, 0, 0);
483 XDestroyWindow(server.dsp, traywin->id);
484 XSync(server.dsp, False);
485 XSetErrorHandler(old);
486 if (traywin->render_timeout)
487 stop_timeout(traywin->render_timeout);
488 g_free(traywin);
489
490 // changed in systray force resize on panel
491 Panel *panel = systray.area.panel;
492 panel->area.resize = 1;
493 panel_refresh = 1;
494 }
495
496
497 void net_message(XClientMessageEvent *e)
498 {
499 unsigned long opcode;
500 Window id;
501
502 opcode = e->data.l[1];
503 switch (opcode) {
504 case SYSTEM_TRAY_REQUEST_DOCK:
505 id = e->data.l[2];
506 if (id) add_icon(id);
507 break;
508
509 case SYSTEM_TRAY_BEGIN_MESSAGE:
510 case SYSTEM_TRAY_CANCEL_MESSAGE:
511 // we don't show baloons messages.
512 break;
513
514 default:
515 if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA)
516 printf("message from dockapp: %s\n", e->data.b);
517 else
518 fprintf(stderr, "SYSTEM_TRAY : unknown message type\n");
519 break;
520 }
521 }
522
523 void systray_render_icon_now(void* t)
524 {
525 // we end up in this function only in real transparency mode or if systray_task_asb != 100 0 0
526 // we made also sure, that we always have a 32 bit visual, i.e. we can safely create 32 bit pixmaps here
527 TrayWindow* traywin = t;
528 traywin->render_timeout = 0;
529
530 // good systray icons support 32 bit depth, but some icons are still 24 bit.
531 // We create a heuristic mask for these icons, i.e. we get the rgb value in the top left corner, and
532 // mask out all pixel with the same rgb value
533 Panel* panel = systray.area.panel;
534
535 // Very ugly hack, but somehow imlib2 is not able to get the image from the traywindow itself,
536 // so we first render the tray window onto a pixmap, and then we tell imlib2 to use this pixmap as
537 // drawable. If someone knows why it does not work with the traywindow itself, please tell me ;)
538 Pixmap tmp_pmap = XCreatePixmap(server.dsp, server.root_win, traywin->width, traywin->height, 32);
539 XRenderPictFormat* f;
540 if (traywin->depth == 24)
541 f = XRenderFindStandardFormat(server.dsp, PictStandardRGB24);
542 else if (traywin->depth == 32)
543 f = XRenderFindStandardFormat(server.dsp, PictStandardARGB32);
544 else {
545 printf("Strange tray icon found with depth: %d\n", traywin->depth);
546 return;
547 }
548 Picture pict_image = XRenderCreatePicture(server.dsp, traywin->id, f, 0, 0);
549 Picture pict_drawable = XRenderCreatePicture(server.dsp, tmp_pmap, XRenderFindVisualFormat(server.dsp, server.visual32), 0, 0);
550 XRenderComposite(server.dsp, PictOpSrc, pict_image, None, pict_drawable, 0, 0, 0, 0, 0, 0, traywin->width, traywin->height);
551 XRenderFreePicture(server.dsp, pict_image);
552 XRenderFreePicture(server.dsp, pict_drawable);
553 // end of the ugly hack and we can continue as before
554
555 imlib_context_set_visual(server.visual32);
556 imlib_context_set_colormap(server.colormap32);
557 imlib_context_set_drawable(tmp_pmap);
558 Imlib_Image image = imlib_create_image_from_drawable(0, 0, 0, traywin->width, traywin->height, 1);
559 if (image == 0)
560 return;
561
562 imlib_context_set_image(image);
563 imlib_image_set_has_alpha(1);
564 DATA32* data = imlib_image_get_data();
565 if (traywin->depth == 24) {
566 createHeuristicMask(data, traywin->width, traywin->height);
567 }
568 if (systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0)
569 adjust_asb(data, traywin->width, traywin->height, systray.alpha, (float)systray.saturation/100, (float)systray.brightness/100);
570 imlib_image_put_back_data(data);
571 XCopyArea(server.dsp, render_background, systray.area.pix, server.gc, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height, traywin->x-systray.area.posx, traywin->y-systray.area.posy);
572 render_image(systray.area.pix, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height);
573 XCopyArea(server.dsp, systray.area.pix, panel->main_win, server.gc, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height, traywin->x, traywin->y);
574 imlib_free_image_and_decache();
575 XFreePixmap(server.dsp, tmp_pmap);
576 imlib_context_set_visual(server.visual);
577 imlib_context_set_colormap(server.colormap);
578
579 if (traywin->damage)
580 XDamageSubtract(server.dsp, traywin->damage, None, None);
581 XFlush(server.dsp);
582 }
583
584
585 void systray_render_icon(TrayWindow* traywin)
586 {
587 if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
588 // wine tray icons update whenever mouse is over them, so we limit the updates to 50 ms
589 if (traywin->render_timeout == 0)
590 traywin->render_timeout = add_timeout(50, 0, systray_render_icon_now, traywin);
591 }
592 else {
593 // comment by andreas: I'm still not sure, what exactly we need to do here... Somehow trayicons which do not
594 // offer the same depth as tint2 does, need to draw a background pixmap, but this cannot be done with
595 // XCopyArea... So we actually need XRenderComposite???
596 // Pixmap pix = XCreatePixmap(server.dsp, server.root_win, traywin->width, traywin->height, server.depth);
597 // XCopyArea(server.dsp, panel->temp_pmap, pix, server.gc, traywin->x, traywin->y, traywin->width, traywin->height, 0, 0);
598 // XSetWindowBackgroundPixmap(server.dsp, traywin->id, pix);
599 XClearArea(server.dsp, traywin->tray_id, 0, 0, traywin->width, traywin->height, True);
600 }
601 }
602
603
604 void refresh_systray_icon()
605 {
606 TrayWindow *traywin;
607 GSList *l;
608 for (l = systray.list_icons; l ; l = l->next) {
609 traywin = (TrayWindow*)l->data;
610 if (traywin->hide) continue;
611 systray_render_icon(traywin);
612 }
613 }
This page took 0.065023 seconds and 4 git commands to generate.