all repos — tint2 @ e8869b4d8736ffe8e88e0f064ff34f7f5f34ca0b

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

systray: Minor change in error logging
o9000 o9000
commit

e8869b4d8736ffe8e88e0f064ff34f7f5f34ca0b

parent

b1b95e086db04bc8f779ba434c5b58efc8f38100

1 files changed, 16 insertions(+), 10 deletions(-)

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

@@ -330,7 +330,7 @@ int window_error_handler(Display *d, XErrorEvent *e)

{ error = TRUE; if (e->error_code != BadWindow) { - printf("error_handler %d\n", e->error_code); + printf("systray: error code %d\n", e->error_code); } return 0; }

@@ -489,12 +489,17 @@ return TRUE;

Panel* panel = systray.area.panel; + // Reparent error = FALSE; XErrorHandler old = XSetErrorHandler(window_error_handler); - - // Reparent XReparentWindow(server.dsp, traywin->win, traywin->parent, 0, 0); XSync(server.dsp, False); + XSetErrorHandler(old); + if (error != FALSE) { + printf("systray %d: cannot embed icon for window %lu pid %d\n", __LINE__, traywin->win, traywin->pid); + remove_icon(traywin); + return FALSE; + } traywin->reparented = 1;

@@ -512,8 +517,16 @@ e.xclient.data.l[1] = XEMBED_EMBEDDED_NOTIFY;

e.xclient.data.l[2] = 0; e.xclient.data.l[3] = traywin->parent; e.xclient.data.l[4] = 0; + error = FALSE; + XErrorHandler old = XSetErrorHandler(window_error_handler); XSendEvent(server.dsp, traywin->win, False, 0xFFFFFF, &e); XSync(server.dsp, False); + XSetErrorHandler(old); + if (error != FALSE) { + printf("systray %d: cannot embed icon for window %lu pid %d\n", __LINE__, traywin->win, traywin->pid); + remove_icon(traywin); + return FALSE; + } } // Check if window was embedded

@@ -544,13 +557,6 @@ // Redirect rendering when using compositing

if (systray_composited) { traywin->damage = XDamageCreate(server.dsp, traywin->parent, XDamageReportRawRectangles); XCompositeRedirectWindow(server.dsp, traywin->parent, CompositeRedirectManual); - } - - XSync(server.dsp, False); - XSetErrorHandler(old); - if (error != FALSE) { - remove_icon(traywin); - return FALSE; } // Make the icon visible