]> Dogcows Code - chaz/tint2/blobdiff - src/systray/systraybar.c
fixed : redraw all task state when background changed
[chaz/tint2] / src / systray / systraybar.c
index c07ae74c717343c094b406e3e27673d45dd2439b..8b613a6fc7ecd0602a32edd3192d975a510614d6 100644 (file)
@@ -113,7 +113,7 @@ void resize_systray(void *obj)
        TrayWindow *traywin;
        GSList *l;
        int count, icon_size;
-       int icons_per_column, icons_per_row, marging;
+       int icons_per_column=1, icons_per_row=1, marging=0;
 
        if (panel_horizontal)
                icon_size = sysbar->area.height;
@@ -345,7 +345,17 @@ gboolean add_icon(Window id)
 
        error = FALSE;
        XWindowAttributes attr;
+/*     GSList *l;
+       printf("add_icon\n");
+       for (l = systray.list_icons; l ; l = l->next) {
+               traywin = (TrayWindow*)l->data;
+               //if (traywin->hide) continue;
+
+               XGetWindowAttributes(server.dsp, traywin->tray_id, &attr);
+               printf("  icon %lx, depth %d, width %d, height %d\n", traywin->tray_id, attr.depth, attr.width, attr.height);
+       }*/
        XGetWindowAttributes(server.dsp, id, &attr);
+       //printf("last icon %lx, depth %d, width %d, height %d\n", id, attr.depth, attr.width, attr.height);
        unsigned long mask = 0;
        XSetWindowAttributes set_attr;
        if (attr.depth != server.depth || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0 ) {
@@ -434,10 +444,10 @@ gboolean add_icon(Window id)
        }
 
        // show the window
-       if (!traywin->hide) {
-               XMapRaised(server.dsp, traywin->tray_id);
+       if (!traywin->hide)
+               XMapWindow(server.dsp, traywin->tray_id);
+       if (!traywin->hide && !panel->is_hidden)
                XMapRaised(server.dsp, traywin->id);
-       }
 
        // changed in systray force resize on panel
        panel->area.resize = 1;
@@ -553,7 +563,6 @@ void systray_render_icon(TrayWindow* traywin)
 
 void refresh_systray_icon()
 {
-       Panel* panel = systray.area.panel;
        TrayWindow *traywin;
        GSList *l;
        for (l = systray.list_icons; l ; l = l->next) {
@@ -562,10 +571,13 @@ void refresh_systray_icon()
                if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0)
                        systray_render_icon(traywin);
                else {
-                       Pixmap pix = XCreatePixmap(server.dsp, server.root_win, traywin->width, traywin->height, server.depth);
-                       XCopyArea(server.dsp, panel->temp_pmap, pix, server.gc, traywin->x, traywin->y, traywin->width, traywin->height, 0, 0);
+                       // comment by andreas: I'm still not sure, what exactly we need to do here... Somehow trayicons which do not
+                       // offer the same depth as tint2 does, need to draw a background pixmap, but this cannot be done with
+                       // XCopyArea... So we actually need XRenderComposite???
+//                     Pixmap pix = XCreatePixmap(server.dsp, server.root_win, traywin->width, traywin->height, server.depth);
+//                     XCopyArea(server.dsp, panel->temp_pmap, pix, server.gc, traywin->x, traywin->y, traywin->width, traywin->height, 0, 0);
+//                     XSetWindowBackgroundPixmap(server.dsp, traywin->id, pix);
                        XClearArea(server.dsp, traywin->tray_id, 0, 0, traywin->width, traywin->height, True);
-                       XSetWindowBackgroundPixmap(server.dsp, traywin->id, pix);
                }
        }
 }
This page took 0.02122 seconds and 4 git commands to generate.