]> Dogcows Code - chaz/tint2/blobdiff - src/systray/systraybar.c
*fix* wrong XClearArea usage
[chaz/tint2] / src / systray / systraybar.c
index 454245af3456192777349a34e3c2a7dbb2d9ee2e..b92f38b10008cf9176b2880534c0a8fbd489e324 100644 (file)
@@ -40,7 +40,7 @@ GSList *icons;
 #define SYSTEM_TRAY_CANCEL_MESSAGE  2
 
 // selection window
-Window net_sel_win = None, hint_win = None;
+Window net_sel_win = None;
 
 // freedesktop specification doesn't allow multi systray
 Systraybar systray;
@@ -250,7 +250,7 @@ void start_net()
        // init systray protocol
        net_sel_win = XCreateSimpleWindow(server.dsp, server.root_win, -1, -1, 1, 1, 0, 0, 0);
 
-       // v0.2 trayer specification. tint2 always horizontal.
+       // v0.3 trayer specification. tint2 always horizontal.
        // Vertical panel will draw the systray horizontal.
        int orient = 0;
        XChangeProperty(server.dsp, net_sel_win, server.atom._NET_SYSTEM_TRAY_ORIENTATION, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &orient, 1);
@@ -423,7 +423,7 @@ gboolean add_icon(Window id)
        // watch for the icon trying to resize itself!
        XSelectInput(server.dsp, traywin->tray_id, StructureNotifyMask);
        if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
-               traywin->damage = XDamageCreate(server.dsp, traywin->id, XDamageReportRawRectangles);
+               traywin->damage = XDamageCreate(server.dsp, traywin->id, XDamageReportNonEmpty);
                XCompositeRedirectWindow(server.dsp, traywin->id, CompositeRedirectManual);
        }
 
@@ -498,8 +498,9 @@ void net_message(XClientMessageEvent *e)
        }
 }
 
-void systray_render_icon_now(TrayWindow* traywin)
+void systray_render_icon_now(void* t)
 {
+       TrayWindow* traywin = t;
        traywin->render_timeout = 0;
 
        // good systray icons support 32 bit depth, but some icons are still 24 bit.
@@ -531,9 +532,11 @@ void systray_render_icon_now(TrayWindow* traywin)
        XCopyArea(server.dsp, systray.area.pix.pmap, panel->main_win, server.gc, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height, traywin->x, traywin->y);
        imlib_free_image_and_decache();
 
+       XDamageSubtract(server.dsp, traywin->damage, None, None);
        XFlush(server.dsp);
 }
 
+
 void systray_render_icon(TrayWindow* traywin)
 {
        // wine tray icons update whenever mouse is over them, so we limit the updates to 50 ms
@@ -552,9 +555,6 @@ void refresh_systray_icon()
                if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0)
                        systray_render_icon(traywin);
                else
-                       XClearArea(server.dsp, traywin->id, 0, 0, traywin->width, traywin->height, True);
+                       XClearArea(server.dsp, traywin->tray_id, 0, 0, traywin->width, traywin->height, True);
        }
-//
-//     if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0)
-//             XFlush(server.dsp);
 }
This page took 0.021458 seconds and 4 git commands to generate.