Better error handling in systray icon rendering
This commit is contained in:
@@ -610,17 +610,20 @@ void systray_render_icon_now(void* t)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int empty = 1;
|
||||||
XImage *ximage = XGetImage(server.dsp, traywin->tray_id, 0, 0, traywin->width, traywin->height, AllPlanes, XYPixmap);
|
XImage *ximage = XGetImage(server.dsp, traywin->tray_id, 0, 0, traywin->width, traywin->height, AllPlanes, XYPixmap);
|
||||||
XColor color;
|
if (ximage) {
|
||||||
int x, y, empty = 1;
|
XColor color;
|
||||||
for (x = 0; empty && x < traywin->width; x++) {
|
int x, y;
|
||||||
for (y = 0; empty && y < traywin->height; y++) {
|
for (x = 0; empty && x < traywin->width; x++) {
|
||||||
color.pixel = XGetPixel(ximage, x, y);
|
for (y = 0; empty && y < traywin->height; y++) {
|
||||||
if (color.pixel != 0)
|
color.pixel = XGetPixel(ximage, x, y);
|
||||||
empty = 0;
|
if (color.pixel != 0)
|
||||||
|
empty = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
XFree(ximage);
|
||||||
}
|
}
|
||||||
XFree(ximage);
|
|
||||||
if (traywin->empty != empty) {
|
if (traywin->empty != empty) {
|
||||||
traywin->empty = empty;
|
traywin->empty = empty;
|
||||||
systray.area.resize = 1;
|
systray.area.resize = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user