Better error handling in systray icon rendering
This commit is contained in:
parent
5acda6a0c0
commit
6014b51850
1 changed files with 11 additions and 8 deletions
|
@ -610,17 +610,20 @@ void systray_render_icon_now(void* t)
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue