From e3622275147181a2876e45397f5fc7ed063b8bb8 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 3 Jun 2014 11:28:40 -0400 Subject: [PATCH] window-x11: Don't ever send ConfigureNotifies for OR windows There's a race here. If an OR window hides itself, moves, and then shows itself, we will send a ConfigureNotify for the old size of the window and might receive it after the client moves itself, causing us to show the window at the wrong location. Simply not sending the ConfigureNotify is the easiest thing to do. --- src/x11/window-x11.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index be5754608..703422432 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -204,6 +204,8 @@ send_configure_notify (MetaWindow *window) MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11); XEvent event; + g_assert (!window->override_redirect); + /* from twm */ event.type = ConfigureNotify; @@ -650,12 +652,6 @@ meta_window_x11_unmanage (MetaWindow *window) if (META_DISPLAY_HAS_SHAPE (window->display)) XShapeSelectInput (window->display->xdisplay, window->xwindow, NoEventMask); - /* The XReparentWindow call in meta_window_destroy_frame() moves the - * window so we need to send a configure notify; see bug 399552. (We - * also do this just in case a window got unmaximized.) - */ - send_configure_notify (window); - meta_window_ungrab_keys (window); meta_display_ungrab_window_buttons (window->display, window->xwindow); meta_display_ungrab_focus_window_button (window->display, window); @@ -663,7 +659,15 @@ meta_window_x11_unmanage (MetaWindow *window) meta_error_trap_pop (window->display); if (window->frame) - meta_window_destroy_frame (window); + { + /* The XReparentWindow call in meta_window_destroy_frame() moves the + * window so we need to send a configure notify; see bug 399552. (We + * also do this just in case a window got unmaximized.) + */ + send_configure_notify (window); + + meta_window_destroy_frame (window); + } } static void