panel.clock.area.draw_foreground = draw_foreground_clock;
g_task.area.draw_foreground = draw_foreground_task;
window.main_win = 0;
-
- // append full transparency background
- //Area *back = calloc(1, sizeof(Area));
- list_back = g_slist_append(0, calloc(1, sizeof(Area)));
-
+
server.dsp = XOpenDisplay (NULL);
if (!server.dsp) {
fprintf(stderr, "Could not open display.\n");
/* Catch events */
XSelectInput (server.dsp, server.root_win, PropertyChangeMask|StructureNotifyMask);
- setlocale(LC_ALL, "");
+ setlocale (LC_ALL, "");
}
else if (at == server.atom._NET_NUMBER_OF_DESKTOPS) {
config_taskbar();
visible_object();
- redraw(&panel.area);
}
/* Change desktop */
else if (at == server.atom._NET_CURRENT_DESKTOP) {
}
/* Wallpaper changed */
else if (at == server.atom._XROOTPMAP_ID) {
- XFreePixmap (server.dsp, server.root_pmap);
- server.root_pmap = 0;
- redraw(&panel.area);
- panel.clock.area.redraw = 1;
+ XFreePixmap (server.dsp, panel.area.pmap);
+ panel.area.pmap = 0;
panel.refresh = 1;
}
}
}
/* Window icon changed */
else if (at == server.atom._NET_WM_ICON) {
- if (tsk->icon_data != 0) XFree (tsk->icon_data);
+ if (tsk->icon_data) {
+ free (tsk->icon_data);
+ tsk->icon_data = 0;
+ }
tsk->area.redraw = 1;
- tsk->icon_data = 0;
panel.refresh = 1;
}
/* Window desktop changed */
init ();
load_config:
- if (server.root_pmap) XFreePixmap (server.dsp, server.root_pmap);
- server.root_pmap = 0;
+ if (panel.area.pmap) XFreePixmap (server.dsp, panel.area.pmap);
+ panel.area.pmap = 0;
+ // append full transparency background
+ list_back = g_slist_append(0, calloc(1, sizeof(Area)));
+
// read tint2rc config
i = 0;
if (c != -1)
window_draw_panel ();
- // BUG: draw(clock) is needed here, but 'on the paper' it's not necessary.
- draw(&panel.clock.area);
+ // BUG: refresh(clock) is needed here, but 'on the paper' it's not necessary.
+ refresh(&panel.clock.area);
x11_fd = ConnectionNumber (server.dsp);
XSync (server.dsp, False);
break;
case Expose:
- XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, 0, 0, panel.area.width, panel.area.height, 0, 0);
+ XCopyArea (server.dsp, panel.area.pmap, server.root_win, server.gc_root, 0, 0, panel.area.width, panel.area.height, server.posx, server.posy);
+ XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, panel.area.paddingx, 0, panel.area.width-(2*panel.area.paddingx), panel.area.height, 0, 0);
break;
case PropertyNotify: