[mutter] window-x11: Don't ever send ConfigureNotifies for OR windows



commit e3622275147181a2876e45397f5fc7ed063b8bb8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jun 3 11:28:40 2014 -0400

    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 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index be57546..7034224 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]