]> Dogcows Code - chaz/tint2/blobdiff - src/systray/systraybar.c
*fix* register for the StructureNotifyEventMask early, since an icon can be created...
[chaz/tint2] / src / systray / systraybar.c
index 539b32985696daba5ba1d186145c1ea8fcd7c7ac..8a92a0452ff8d083596ff8632986bc4ebf3ef0b6 100644 (file)
@@ -98,7 +98,9 @@ void init_systray_panel(void *p)
 {
        systray.area.parent = p;
        systray.area.panel = p;
-       
+       if (systray.area.bg == 0)
+               systray.area.bg = &g_array_index(backgrounds, Background, 0);
+
        GSList *l;
        int count = 0;
        for (l = systray.list_icons; l ; l = l->next) {
@@ -352,6 +354,9 @@ gboolean add_icon(Window id)
        Panel *panel = systray.area.panel;
        int hide = 0;
 
+       // watch for the icon trying to resize itself / closing again!
+       XSelectInput(server.dsp, id, StructureNotifyMask);
+
        error = FALSE;
        XWindowAttributes attr;
        if ( XGetWindowAttributes(server.dsp, id, &attr) == False ) return FALSE;
@@ -440,8 +445,6 @@ gboolean add_icon(Window id)
                systray.list_icons = g_slist_insert_sorted(systray.list_icons, traywin, compare_traywindows);
        //printf("add_icon id %lx, %d\n", id, g_slist_length(systray.list_icons));
 
-       // watch for the icon trying to resize itself!
-       XSelectInput(server.dsp, traywin->tray_id, StructureNotifyMask);
        if (server.real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
                traywin->damage = XDamageCreate(server.dsp, traywin->id, XDamageReportRawRectangles);
                XCompositeRedirectWindow(server.dsp, traywin->id, CompositeRedirectManual);
This page took 0.021386 seconds and 4 git commands to generate.