all repos — tint2 @ 6014b51850d2b3d696daaef7bf2229bd0848aed9

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Better error handling in systray icon rendering
o9000 o9000
commit

6014b51850d2b3d696daaef7bf2229bd0848aed9

parent

5acda6a0c0c7a24a5176a5fd128cb89737edf69d

1 files changed, 11 insertions(+), 8 deletions(-)

jump to
M src/systray/systraybar.csrc/systray/systraybar.c

@@ -610,17 +610,20 @@ systray_render_icon(traywin);

return; } + int empty = 1; XImage *ximage = XGetImage(server.dsp, traywin->tray_id, 0, 0, traywin->width, traywin->height, AllPlanes, XYPixmap); - XColor color; - int x, y, empty = 1; - for (x = 0; empty && x < traywin->width; x++) { - for (y = 0; empty && y < traywin->height; y++) { - color.pixel = XGetPixel(ximage, x, y); - if (color.pixel != 0) - empty = 0; + if (ximage) { + XColor color; + int x, y; + for (x = 0; empty && x < traywin->width; x++) { + for (y = 0; empty && y < traywin->height; y++) { + color.pixel = XGetPixel(ximage, x, y); + if (color.pixel != 0) + empty = 0; + } } + XFree(ximage); } - XFree(ximage); if (traywin->empty != empty) { traywin->empty = empty; systray.area.resize = 1;