]> Dogcows Code - chaz/tint2/blob - src/tint.c
fixed issue 134
[chaz/tint2] / src / tint.c
1 /**************************************************************************
2 *
3 * Tint2 panel
4 *
5 * Copyright (C) 2007 Pål Staurland (staura@gmail.com)
6 * Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 **************************************************************************/
20
21 #include <sys/stat.h>
22 #include <sys/time.h>
23 #include <unistd.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <X11/Xutil.h>
28 #include <X11/Xatom.h>
29 #include <X11/Xlocale.h>
30 #include <Imlib2.h>
31 #include <signal.h>
32
33 #include "server.h"
34 #include "window.h"
35 #include "config.h"
36 #include "task.h"
37 #include "taskbar.h"
38 #include "systraybar.h"
39 #include "panel.h"
40
41
42 void signal_handler(int sig)
43 {
44 // signal handler is light as it should be
45 signal_pending = sig;
46 }
47
48
49 void init (int argc, char *argv[])
50 {
51 int c;
52
53 // read options
54 c = getopt (argc, argv, "c:");
55 if (c != -1) {
56 config_path = strdup (optarg);
57 c = getopt (argc, argv, "j:");
58 if (c != -1)
59 thumbnail_path = strdup (optarg);
60 }
61
62 // Set signal handler
63 signal(SIGUSR1, signal_handler);
64 signal(SIGINT, signal_handler);
65 signal(SIGTERM, signal_handler);
66 signal(SIGHUP, signal_handler);
67 signal(SIGCHLD, SIG_IGN); // don't have to wait() after fork()
68
69 // set global data
70 memset(&server, 0, sizeof(Server_global));
71 memset(&systray, 0, sizeof(Systraybar));
72
73 server.dsp = XOpenDisplay (NULL);
74 if (!server.dsp) {
75 fprintf(stderr, "tint2 exit : could not open display.\n");
76 exit(0);
77 }
78 server_init_atoms ();
79 server.screen = DefaultScreen (server.dsp);
80 server.root_win = RootWindow(server.dsp, server.screen);
81 server.depth = DefaultDepth (server.dsp, server.screen);
82 server.visual = DefaultVisual (server.dsp, server.screen);
83 server.desktop = server_get_current_desktop ();
84 XGCValues gcv;
85 server.gc = XCreateGC (server.dsp, server.root_win, (unsigned long)0, &gcv) ;
86
87 XSetErrorHandler ((XErrorHandler) server_catch_error);
88
89 imlib_context_set_display (server.dsp);
90 imlib_context_set_visual (server.visual);
91 imlib_context_set_colormap (DefaultColormap (server.dsp, server.screen));
92
93 /* Catch events */
94 XSelectInput (server.dsp, server.root_win, PropertyChangeMask|StructureNotifyMask);
95
96 setlocale (LC_ALL, "");
97 }
98
99
100 void cleanup()
101 {
102 cleanup_panel();
103
104 if (time1_font_desc) pango_font_description_free(time1_font_desc);
105 if (time2_font_desc) pango_font_description_free(time2_font_desc);
106 if (time1_format) g_free(time1_format);
107 if (time2_format) g_free(time2_format);
108 #ifdef ENABLE_BATTERY
109 if (bat1_font_desc) pango_font_description_free(bat1_font_desc);
110 if (bat2_font_desc) pango_font_description_free(bat2_font_desc);
111 if (battery_low_cmd) g_free(battery_low_cmd);
112 if (path_energy_now) g_free(path_energy_now);
113 if (path_energy_full) g_free(path_energy_full);
114 if (path_current_now) g_free(path_current_now);
115 if (path_status) g_free(path_status);
116 #endif
117 if (clock_lclick_command) g_free(clock_lclick_command);
118 if (clock_rclick_command) g_free(clock_rclick_command);
119 if (config_path) g_free(config_path);
120 if (thumbnail_path) g_free(thumbnail_path);
121
122 if (server.monitor) free(server.monitor);
123 XFreeGC(server.dsp, server.gc);
124 XCloseDisplay(server.dsp);
125 }
126
127
128 Taskbar *click_taskbar (Panel *panel, XEvent *e)
129 {
130 GSList *l0;
131 Taskbar *tskbar = NULL;
132 if (panel_horizontal) {
133 int x = e->xbutton.x;
134 for (l0 = panel->area.list; l0 ; l0 = l0->next) {
135 tskbar = l0->data;
136 if (!tskbar->area.on_screen) continue;
137 if (x >= tskbar->area.posx && x <= (tskbar->area.posx + tskbar->area.width))
138 break;
139 }
140 }
141 else {
142 int y = e->xbutton.y;
143 for (l0 = panel->area.list; l0 ; l0 = l0->next) {
144 tskbar = l0->data;
145 if (!tskbar->area.on_screen) continue;
146 if (y >= tskbar->area.posy && y <= (tskbar->area.posy + tskbar->area.height))
147 break;
148 }
149 }
150 return tskbar;
151 }
152
153
154 Task *click_task (Panel *panel, XEvent *e)
155 {
156 GSList *l0;
157 Taskbar *tskbar;
158
159 if ( (tskbar = click_taskbar(panel, e)) ) {
160 if (panel_horizontal) {
161 int x = e->xbutton.x;
162 Task *tsk;
163 for (l0 = tskbar->area.list; l0 ; l0 = l0->next) {
164 tsk = l0->data;
165 if (x >= tsk->area.posx && x <= (tsk->area.posx + tsk->area.width)) {
166 return tsk;
167 }
168 }
169 }
170 else {
171 int y = e->xbutton.y;
172 Task *tsk;
173 for (l0 = tskbar->area.list; l0 ; l0 = l0->next) {
174 tsk = l0->data;
175 if (y >= tsk->area.posy && y <= (tsk->area.posy + tsk->area.height)) {
176 return tsk;
177 }
178 }
179 }
180 }
181 return NULL;
182 }
183
184
185 int click_padding(Panel *panel, XEvent *e)
186 {
187 if (panel_horizontal) {
188 if (e->xbutton.x < panel->area.paddingxlr || e->xbutton.x > panel->area.width-panel->area.paddingxlr)
189 return 1;
190 }
191 else {
192 if (e->xbutton.y < panel->area.paddingxlr || e->xbutton.y > panel->area.height-panel->area.paddingxlr)
193 return 1;
194 }
195 return 0;
196 }
197
198
199 int click_clock(Panel *panel, XEvent *e)
200 {
201 Clock clk = panel->clock;
202 if (panel_horizontal) {
203 if (clk.area.on_screen && e->xbutton.x >= clk.area.posx && e->xbutton.x <= (clk.area.posx + clk.area.width))
204 return TRUE;
205 } else {
206 if (clk.area.on_screen && e->xbutton.y >= clk.area.posy && e->xbutton.y <= (clk.area.posy + clk.area.height))
207 return TRUE;
208 }
209 return FALSE;
210 }
211
212
213 void window_action (Task *tsk, int action)
214 {
215 if (!tsk) return;
216 int desk;
217 switch (action) {
218 case CLOSE:
219 set_close (tsk->win);
220 break;
221 case TOGGLE:
222 set_active(tsk->win);
223 break;
224 case ICONIFY:
225 XIconifyWindow (server.dsp, tsk->win, server.screen);
226 break;
227 case TOGGLE_ICONIFY:
228 if (tsk == task_active) XIconifyWindow (server.dsp, tsk->win, server.screen);
229 else set_active (tsk->win);
230 break;
231 case SHADE:
232 window_toggle_shade (tsk->win);
233 break;
234 case MAXIMIZE_RESTORE:
235 window_maximize_restore (tsk->win);
236 break;
237 case MAXIMIZE:
238 window_maximize_restore (tsk->win);
239 break;
240 case RESTORE:
241 window_maximize_restore (tsk->win);
242 break;
243 case DESKTOP_LEFT:
244 if ( tsk->desktop == 0 ) break;
245 desk = tsk->desktop - 1;
246 windows_set_desktop(tsk->win, desk);
247 if (desk == server.desktop)
248 set_active(tsk->win);
249 break;
250 case DESKTOP_RIGHT:
251 if (tsk->desktop == server.nb_desktop ) break;
252 desk = tsk->desktop + 1;
253 windows_set_desktop(tsk->win, desk);
254 if (desk == server.desktop)
255 set_active(tsk->win);
256 }
257 }
258
259
260 void event_button_press (XEvent *e)
261 {
262 Panel *panel = get_panel(e->xany.window);
263 if (!panel) return;
264
265 if (panel_mode == MULTI_DESKTOP)
266 task_drag = click_task(panel, e);
267
268 if (wm_menu && !task_drag && !click_clock(panel, e) && (e->xbutton.button != 1) ) {
269 // forward the click to the desktop window (thanks conky)
270 XUngrabPointer(server.dsp, e->xbutton.time);
271 e->xbutton.window = server.root_win;
272 // icewm doesn't open under the mouse.
273 // and xfce doesn't open at all.
274 //e->xbutton.x = e->xbutton.x_root;
275 //e->xbutton.y = e->xbutton.y_root;
276 //printf("**** %d, %d\n", e->xbutton.x, e->xbutton.y);
277 XSetInputFocus(server.dsp, e->xbutton.window, RevertToParent, e->xbutton.time);
278 XSendEvent(server.dsp, e->xbutton.window, False, ButtonPressMask, e);
279 return;
280 }
281
282 XLowerWindow (server.dsp, panel->main_win);
283 }
284
285
286 void event_button_release (XEvent *e)
287 {
288 Panel *panel = get_panel(e->xany.window);
289 if (!panel) return;
290
291 if (wm_menu && click_padding(panel, e)) {
292 // forward the click to the desktop window (thanks conky)
293 e->xbutton.window = server.root_win;
294 XSendEvent(server.dsp, e->xbutton.window, False, ButtonReleaseMask, e);
295 return;
296 }
297
298 int action = TOGGLE_ICONIFY;
299 switch (e->xbutton.button) {
300 case 2:
301 action = mouse_middle;
302 break;
303 case 3:
304 action = mouse_right;
305 break;
306 case 4:
307 action = mouse_scroll_up;
308 break;
309 case 5:
310 action = mouse_scroll_down;
311 break;
312 case 6:
313 action = mouse_tilt_left;
314 break;
315 case 7:
316 action = mouse_tilt_right;
317 break;
318 }
319
320 if ( click_clock(panel, e)) {
321 clock_action(e->xbutton.button);
322 XLowerWindow (server.dsp, panel->main_win);
323 task_drag = 0;
324 return;
325 }
326
327 Taskbar *tskbar;
328 if ( !(tskbar = click_taskbar(panel, e)) ) {
329 // TODO: check better solution to keep window below
330 XLowerWindow (server.dsp, panel->main_win);
331 task_drag = 0;
332 return;
333 }
334
335 // drag and drop task
336 if (task_drag) {
337 if (tskbar != task_drag->area.parent && action == TOGGLE_ICONIFY) {
338 if (task_drag->desktop != ALLDESKTOP && panel_mode == MULTI_DESKTOP) {
339 windows_set_desktop(task_drag->win, tskbar->desktop);
340 if (tskbar->desktop == server.desktop)
341 set_active(task_drag->win);
342 task_drag = 0;
343 }
344 return;
345 }
346 else task_drag = 0;
347 }
348
349 // switch desktop
350 if (panel_mode == MULTI_DESKTOP) {
351 if (tskbar->desktop != server.desktop && action != CLOSE && action != DESKTOP_LEFT && action != DESKTOP_RIGHT)
352 set_desktop (tskbar->desktop);
353 }
354
355 // action on task
356 window_action( click_task(panel, e), action);
357
358 // to keep window below
359 XLowerWindow (server.dsp, panel->main_win);
360 }
361
362
363 void event_property_notify (XEvent *e)
364 {
365 int i, j;
366 Task *tsk;
367 Window win = e->xproperty.window;
368 Atom at = e->xproperty.atom;
369
370 if (win == server.root_win) {
371 if (!server.got_root_win) {
372 XSelectInput (server.dsp, server.root_win, PropertyChangeMask|StructureNotifyMask);
373 server.got_root_win = 1;
374 }
375
376 // Change number of desktops
377 else if (at == server.atom._NET_NUMBER_OF_DESKTOPS) {
378 server.nb_desktop = server_get_number_of_desktop ();
379 cleanup_taskbar();
380 init_taskbar();
381 visible_object();
382 for (i=0 ; i < nb_panel ; i++) {
383 panel1[i].area.resize = 1;
384 }
385 task_refresh_tasklist();
386 panel_refresh = 1;
387 }
388 // Change desktop
389 else if (at == server.atom._NET_CURRENT_DESKTOP) {
390 server.desktop = server_get_current_desktop ();
391 if (panel_mode != MULTI_DESKTOP) {
392 visible_object();
393 }
394 }
395 // Window list
396 else if (at == server.atom._NET_CLIENT_LIST) {
397 task_refresh_tasklist();
398 panel_refresh = 1;
399 }
400 // Change active
401 else if (at == server.atom._NET_ACTIVE_WINDOW) {
402 GSList *l0;
403 if (task_active) {
404 for (i=0 ; i < nb_panel ; i++) {
405 for (j=0 ; j < panel1[i].nb_desktop ; j++) {
406 for (l0 = panel1[i].taskbar[j].area.list; l0 ; l0 = l0->next) {
407 tsk = l0->data;
408 tsk->area.is_active = 0;
409 }
410 }
411 }
412 task_active = 0;
413 }
414 Window w1 = window_get_active ();
415 Task *t = task_get_task(w1);
416 if (!t) {
417 Window w2;
418 if (XGetTransientForHint(server.dsp, w1, &w2) != 0)
419 if (w2) t = task_get_task(w2);
420 }
421 if (task_urgent == t) {
422 init_precision();
423 task_urgent = 0;
424 }
425 // put active state on all task (multi_desktop)
426 if (t) {
427 for (i=0 ; i < nb_panel ; i++) {
428 for (j=0 ; j < panel1[i].nb_desktop ; j++) {
429 for (l0 = panel1[i].taskbar[j].area.list; l0 ; l0 = l0->next) {
430 tsk = l0->data;
431 if (tsk->win == t->win) {
432 tsk->area.is_active = 1;
433 //printf("active monitor %d, task %s\n", panel1[i].monitor, tsk->title);
434 }
435 }
436 }
437 }
438 task_active = t;
439 }
440 panel_refresh = 1;
441 }
442 else if (at == server.atom._XROOTPMAP_ID) {
443 // change Wallpaper
444 for (i=0 ; i < nb_panel ; i++) {
445 set_panel_background(&panel1[i]);
446 }
447 panel_refresh = 1;
448 }
449 }
450 else {
451 tsk = task_get_task (win);
452 if (!tsk) return;
453 //printf("atom root_win = %s, %s\n", XGetAtomName(server.dsp, at), tsk->title);
454
455 // Window title changed
456 if (at == server.atom._NET_WM_VISIBLE_NAME || at == server.atom._NET_WM_NAME || at == server.atom.WM_NAME) {
457 Task *tsk2;
458 GSList *l0;
459 get_title(tsk);
460 // changed other tsk->title
461 for (i=0 ; i < nb_panel ; i++) {
462 for (j=0 ; j < panel1[i].nb_desktop ; j++) {
463 for (l0 = panel1[i].taskbar[j].area.list; l0 ; l0 = l0->next) {
464 tsk2 = l0->data;
465 if (tsk->win == tsk2->win && tsk != tsk2) {
466 tsk2->title = tsk->title;
467 tsk2->area.redraw = 1;
468 }
469 }
470 }
471 }
472 panel_refresh = 1;
473 }
474 // Demand attention
475 else if (at == server.atom._NET_WM_STATE) {
476 if (window_is_urgent (win)) {
477 task_urgent = tsk;
478 tick_urgent = 0;
479 time_precision = 1;
480 }
481 }
482 else if (at == server.atom.WM_STATE) {
483 // Iconic state
484 // TODO : try to delete following code
485 if (window_is_iconified (win)) {
486 if (task_active) {
487 if (task_active->win == tsk->win) {
488 Task *tsk2;
489 GSList *l0;
490 for (i=0 ; i < nb_panel ; i++) {
491 for (j=0 ; j < panel1[i].nb_desktop ; j++) {
492 for (l0 = panel1[i].taskbar[j].area.list; l0 ; l0 = l0->next) {
493 tsk2 = l0->data;
494 tsk2->area.is_active = 0;
495 }
496 }
497 }
498 task_active = 0;
499 }
500 }
501 }
502 }
503 // Window icon changed
504 else if (at == server.atom._NET_WM_ICON) {
505 get_icon(tsk);
506 Task *tsk2;
507 GSList *l0;
508 for (i=0 ; i < nb_panel ; i++) {
509 for (j=0 ; j < panel1[i].nb_desktop ; j++) {
510 for (l0 = panel1[i].taskbar[j].area.list; l0 ; l0 = l0->next) {
511 tsk2 = l0->data;
512 if (tsk->win == tsk2->win && tsk != tsk2) {
513 tsk2->icon_width = tsk->icon_width;
514 tsk2->icon_height = tsk->icon_height;
515 tsk2->icon_data = tsk->icon_data;
516 tsk2->icon_data_active = tsk->icon_data_active;
517 tsk2->area.redraw = 1;
518 }
519 }
520 }
521 }
522 panel_refresh = 1;
523 }
524 // Window desktop changed
525 else if (at == server.atom._NET_WM_DESKTOP) {
526 int desktop = window_get_desktop (win);
527 int active = tsk->area.is_active;
528 //printf(" Window desktop changed %d, %d\n", tsk->desktop, desktop);
529 // bug in windowmaker : send unecessary 'desktop changed' when focus changed
530 if (desktop != tsk->desktop) {
531 remove_task (tsk);
532 tsk = add_task (win);
533 if (tsk && active) {
534 tsk->area.is_active = 1;
535 task_active = tsk;
536 }
537 panel_refresh = 1;
538 }
539 }
540
541 if (!server.got_root_win) server.root_win = RootWindow (server.dsp, server.screen);
542 }
543 }
544
545
546 void event_expose (XEvent *e)
547 {
548 Panel *panel;
549
550 panel = get_panel(e->xany.window);
551 if (!panel) return;
552 // TODO : one panel_refresh per panel ?
553 panel_refresh = 1;
554 }
555
556
557 void event_configure_notify (Window win)
558 {
559 // check 'win' move in systray
560 TrayWindow *traywin;
561 GSList *l;
562 for (l = systray.list_icons; l ; l = l->next) {
563 traywin = (TrayWindow*)l->data;
564 if (traywin->id == win) {
565 //printf("move tray %d\n", traywin->x);
566 XMoveResizeWindow(server.dsp, traywin->id, traywin->x, traywin->y, traywin->width, traywin->height);
567 panel_refresh = 1;
568 return;
569 }
570 }
571
572 // check 'win' move in another monitor
573 if (nb_panel == 1) return;
574 if (server.nb_monitor == 1) return;
575 Task *tsk = task_get_task (win);
576 if (!tsk) return;
577
578 Panel *p = tsk->area.panel;
579 if (p->monitor != window_get_monitor (win)) {
580 remove_task (tsk);
581 add_task (win);
582 if (win == window_get_active ()) {
583 Task *tsk = task_get_task (win);
584 tsk->area.is_active = 1;
585 task_active = tsk;
586 }
587 panel_refresh = 1;
588 }
589 }
590
591
592 void event_timer()
593 {
594 struct timeval stv;
595 int i;
596
597 if (gettimeofday(&stv, 0)) return;
598
599 if (abs(stv.tv_sec - time_clock.tv_sec) < time_precision) return;
600 time_clock.tv_sec = stv.tv_sec;
601 time_clock.tv_sec -= time_clock.tv_sec % time_precision;
602
603 // urgent task
604 if (task_urgent) {
605 if (tick_urgent < max_tick_urgent) {
606 task_urgent->area.is_active = !task_urgent->area.is_active;
607 task_urgent->area.redraw = 1;
608 tick_urgent++;
609 }
610 }
611
612 // update battery
613 #ifdef ENABLE_BATTERY
614 if (panel1[0].battery.area.on_screen) {
615 update_battery();
616 for (i=0 ; i < nb_panel ; i++)
617 panel1[i].battery.area.resize = 1;
618 }
619 #endif
620
621 // update clock
622 if (time1_format) {
623 for (i=0 ; i < nb_panel ; i++)
624 panel1[i].clock.area.resize = 1;
625 }
626 panel_refresh = 1;
627 }
628
629
630 int main (int argc, char *argv[])
631 {
632 XEvent e;
633 fd_set fd;
634 int x11_fd, i;
635 struct timeval tv;
636 Panel *panel;
637 GSList *it;
638
639 init (argc, argv);
640
641 load_config:
642 i = 0;
643 init_config();
644 if (config_path)
645 i = config_read_file (config_path);
646 else
647 i = config_read ();
648 if (!i) {
649 fprintf(stderr, "usage: tint2 [-c] <config_file>\n");
650 cleanup();
651 exit(1);
652 }
653 config_finish();
654 if (thumbnail_path) {
655 // usage: tint2 -j <file> for internal use
656 printf("file %s\n", thumbnail_path);
657 cleanup();
658 exit(0);
659 }
660
661 x11_fd = ConnectionNumber(server.dsp);
662 XSync(server.dsp, False);
663
664 while (1) {
665 // thanks to AngryLlama for the timer
666 // Create a File Description Set containing x11_fd
667 FD_ZERO (&fd);
668 FD_SET (x11_fd, &fd);
669
670 tv.tv_usec = 500000;
671 tv.tv_sec = 0;
672
673 // Wait for X Event or a Timer
674 if (select(x11_fd+1, &fd, 0, 0, &tv)) {
675 while (XPending (server.dsp)) {
676 XNextEvent(server.dsp, &e);
677
678 switch (e.type) {
679 case ButtonPress:
680 event_button_press (&e);
681 break;
682
683 case ButtonRelease:
684 event_button_release(&e);
685 break;
686
687 case Expose:
688 event_expose(&e);
689 break;
690
691 case PropertyNotify:
692 event_property_notify(&e);
693 break;
694
695 case ConfigureNotify:
696 if (e.xconfigure.window == server.root_win)
697 goto load_config;
698 else
699 event_configure_notify (e.xconfigure.window);
700 break;
701
702 case ReparentNotify:
703 if (!systray.area.on_screen)
704 break;
705 panel = (Panel*)systray.area.panel;
706 if (e.xany.window == panel->main_win) // reparented to us
707 break;
708 // FIXME: 'reparent to us' badly detected => disabled
709 break;
710 case UnmapNotify:
711 case DestroyNotify:
712 if (!systray.area.on_screen)
713 break;
714 for (it = systray.list_icons; it; it = g_slist_next(it)) {
715 if (((TrayWindow*)it->data)->id == e.xany.window) {
716 remove_icon((TrayWindow*)it->data);
717 break;
718 }
719 }
720 break;
721
722 case ClientMessage:
723 if (!systray.area.on_screen) break;
724 if (e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE && e.xclient.format == 32 && e.xclient.window == net_sel_win) {
725 net_message(&e.xclient);
726 }
727 break;
728 }
729 }
730 }
731 event_timer();
732
733 switch (signal_pending) {
734 case SIGUSR1:
735 signal_pending = 0;
736 goto load_config;
737 case SIGINT:
738 case SIGTERM:
739 case SIGHUP:
740 cleanup ();
741 return 0;
742 }
743
744 if (panel_refresh) {
745 panel_refresh = 0;
746
747 if (refresh_systray) {
748 panel = (Panel*)systray.area.panel;
749 XSetWindowBackgroundPixmap (server.dsp, panel->main_win, None);
750 }
751 for (i=0 ; i < nb_panel ; i++) {
752 panel = &panel1[i];
753
754 if (panel->temp_pmap) XFreePixmap(server.dsp, panel->temp_pmap);
755 panel->temp_pmap = XCreatePixmap(server.dsp, server.root_win, panel->area.width, panel->area.height, server.depth);
756
757 refresh(&panel->area);
758 XCopyArea(server.dsp, panel->temp_pmap, panel->main_win, server.gc, 0, 0, panel->area.width, panel->area.height, 0, 0);
759 }
760 XFlush (server.dsp);
761
762 if (refresh_systray) {
763 refresh_systray = 0;
764 panel = (Panel*)systray.area.panel;
765 // tint2 doen't draw systray icons. it just redraw background.
766 XSetWindowBackgroundPixmap (server.dsp, panel->main_win, panel->temp_pmap);
767 // force icon's refresh
768 refresh_systray_icon();
769 }
770 }
771 }
772 }
773
774
This page took 0.067598 seconds and 5 git commands to generate.