]> Dogcows Code - chaz/tint2/blobdiff - src/systray/systraybar.c
*fix* removed warnings
[chaz/tint2] / src / systray / systraybar.c
index 57505aa6d141cd81b320177f35abeb34515bd67c..a0c1f3c716ee275136da229a10b7ed7513de9051 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;
@@ -434,10 +434,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;
@@ -464,7 +464,7 @@ void remove_icon(TrayWindow *traywin)
        error = FALSE;
        old = XSetErrorHandler(window_error_handler);
        if (!traywin->hide)
-               XUnmapWindow(server.dsp, traywin->id);
+               XUnmapWindow(server.dsp, traywin->tray_id);
        XReparentWindow(server.dsp, traywin->tray_id, server.root_win, 0, 0);
        XDestroyWindow(server.dsp, traywin->id);
        XSync(server.dsp, False);
@@ -560,7 +560,14 @@ void refresh_systray_icon()
                if (traywin->hide) continue;
                if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0)
                        systray_render_icon(traywin);
-               else
+               else {
+                       // 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);
+               }
        }
 }
This page took 0.021048 seconds and 4 git commands to generate.