systray: Watch for window events before reparenting
This commit is contained in:
parent
6438c75faf
commit
5ce8023ef7
1 changed files with 12 additions and 12 deletions
|
@ -611,19 +611,13 @@ gboolean reparent_icon(TrayWindow *traywin)
|
||||||
|
|
||||||
Panel* panel = systray.area.panel;
|
Panel* panel = systray.area.panel;
|
||||||
|
|
||||||
// Reparent
|
// Watch for the icon trying to resize itself / closing again
|
||||||
if (systray_profile)
|
|
||||||
fprintf(stderr, "XSync(server.dsp, False)\n");
|
|
||||||
XSync(server.dsp, False);
|
XSync(server.dsp, False);
|
||||||
error = FALSE;
|
error = FALSE;
|
||||||
XErrorHandler old = XSetErrorHandler(window_error_handler);
|
XErrorHandler old = XSetErrorHandler(window_error_handler);
|
||||||
if (systray_profile)
|
if (systray_profile)
|
||||||
fprintf(stderr, "XReparentWindow(server.dsp, traywin->win, traywin->parent, 0, 0)\n");
|
fprintf(stderr, "XSelectInput(server.dsp, traywin->win, StructureNotifyMask)\n");
|
||||||
XReparentWindow(server.dsp, traywin->win, traywin->parent, 0, 0);
|
XSelectInput(server.dsp, traywin->win, StructureNotifyMask);
|
||||||
if (systray_profile)
|
|
||||||
fprintf(stderr, "XMoveResizeWindow(server.dsp, traywin->win = %ld, 0, 0, traywin->width = %d, traywin->height = %d)\n", traywin->win, traywin->width, traywin->height);
|
|
||||||
XMoveResizeWindow(server.dsp, traywin->win, 0, 0, traywin->width, traywin->height);
|
|
||||||
|
|
||||||
XSync(server.dsp, False);
|
XSync(server.dsp, False);
|
||||||
XSetErrorHandler(old);
|
XSetErrorHandler(old);
|
||||||
if (error != FALSE) {
|
if (error != FALSE) {
|
||||||
|
@ -632,13 +626,19 @@ gboolean reparent_icon(TrayWindow *traywin)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watch for the icon trying to resize itself / closing again
|
// Reparent
|
||||||
|
if (systray_profile)
|
||||||
|
fprintf(stderr, "XSync(server.dsp, False)\n");
|
||||||
XSync(server.dsp, False);
|
XSync(server.dsp, False);
|
||||||
error = FALSE;
|
error = FALSE;
|
||||||
old = XSetErrorHandler(window_error_handler);
|
old = XSetErrorHandler(window_error_handler);
|
||||||
if (systray_profile)
|
if (systray_profile)
|
||||||
fprintf(stderr, "XSelectInput(server.dsp, traywin->win, StructureNotifyMask)\n");
|
fprintf(stderr, "XReparentWindow(server.dsp, traywin->win, traywin->parent, 0, 0)\n");
|
||||||
XSelectInput(server.dsp, traywin->win, StructureNotifyMask);
|
XReparentWindow(server.dsp, traywin->win, traywin->parent, 0, 0);
|
||||||
|
if (systray_profile)
|
||||||
|
fprintf(stderr, "XMoveResizeWindow(server.dsp, traywin->win = %ld, 0, 0, traywin->width = %d, traywin->height = %d)\n", traywin->win, traywin->width, traywin->height);
|
||||||
|
XMoveResizeWindow(server.dsp, traywin->win, 0, 0, traywin->width, traywin->height);
|
||||||
|
|
||||||
XSync(server.dsp, False);
|
XSync(server.dsp, False);
|
||||||
XSetErrorHandler(old);
|
XSetErrorHandler(old);
|
||||||
if (error != FALSE) {
|
if (error != FALSE) {
|
||||||
|
|
Loading…
Reference in a new issue