]> Dogcows Code - chaz/tint2/blobdiff - src/tint.c
*fix* use XSetWindowBackground in hidden mode (otherwise the painting is deferred)
[chaz/tint2] / src / tint.c
index 5b042a87e4aef59df8a6d1bd3d30378271ea961a..a8cc19d71b8cf27325a18e11b238cd022eee8403 100644 (file)
@@ -157,7 +157,7 @@ void cleanup()
        if (snapshot_path) g_free(snapshot_path);
 
        cleanup_server();
-       XCloseDisplay(server.dsp);
+       if (server.dsp) XCloseDisplay(server.dsp);
 }
 
 
@@ -310,6 +310,7 @@ void event_button_release (XEvent *e)
 
        if (wm_menu && !tint2_handles_click(panel, &e->xbutton)) {
                forward_click(e);
+               XLowerWindow (server.dsp, panel->main_win);
                task_drag = 0;
                return;
        }
@@ -587,7 +588,7 @@ void event_configure_notify (Window win)
        Panel *p = tsk->area.panel;
        if (p->monitor != window_get_monitor (win)) {
                remove_task (tsk);
-               add_task (win);
+               tsk = add_task (win);
                if (win == window_get_active ()) {
                        set_task_state(tsk, TASK_ACTIVE);
                        task_active = tsk;
@@ -678,8 +679,10 @@ int main (int argc, char *argv[])
                        for (i=0 ; i < nb_panel ; i++) {
                                panel = &panel1[i];
 
-                               if (panel->is_hidden)
+                               if (panel->is_hidden) {
                                        XCopyArea(server.dsp, panel->hidden_pixmap, panel->main_win, server.gc, 0, 0, panel->hidden_width, panel->hidden_height, 0, 0);
+                                       XSetWindowBackgroundPixmap(server.dsp, panel->main_win, panel->hidden_pixmap);
+                               }
                                else {
                                        if (panel->temp_pmap) XFreePixmap(server.dsp, panel->temp_pmap);
                                        panel->temp_pmap = XCreatePixmap(server.dsp, server.root_win, panel->area.width, panel->area.height, server.depth);
@@ -800,9 +803,11 @@ int main (int argc, char *argv[])
 
                                        default:
                                                if (e.type == XDamageNotify+damage_event) {
+                                                       // union needed to avoid strict-aliasing warnings by gcc
+                                                       union { XEvent e; XDamageNotifyEvent de; } event_union = {.e=e};
                                                        TrayWindow *traywin;
                                                        GSList *l;
-                                                       XDamageNotifyEvent* de = (XDamageNotifyEvent*)&e;
+                                                       XDamageNotifyEvent* de = &event_union.de;
                                                        for (l = systray.list_icons; l ; l = l->next) {
                                                                traywin = (TrayWindow*)l->data;
                                                                if ( traywin->id == de->drawable && !de->more ) {
This page took 0.025051 seconds and 4 git commands to generate.