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