[mutter/gnome-3-12] window: Don't try to map / unmap OR windows by ourselves



commit 31afdd4debc9dd6494d292c2fcaefa0081cc81b3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Aug 19 15:57:52 2014 -0400

    window: Don't try to map / unmap OR windows by ourselves
    
    This is bad behavior, and can also cause us to get in an infinite loop
    if an OR window is mapped and unmapped in quick succession. This
    sequence causes a MapNotify followed by an UnmapNotify, and when
    processing the events, we'll call XMapWindow, XUnmapWindow, which will
    put another set of MapNotify, UnmapNotify events in our queue, which we
    then process by calling XMapWindow, XUnmapWindow, and so it goes
    forever, or at least some scheduler uncorks us by making us call
    XMapWindow when the window is already mapped, or XUnmapWindow when the
    window is already unmapped.
    
    We can stop this madness by simply making sure never to call neither
    XMapWindow or XUnmapWindow on OR windows, which is the correct thing to
    do anyway.

 src/core/window.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index e3a5b4e..2e475b3 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -823,6 +823,8 @@ sync_client_window_mapped (MetaWindow *window)
 {
   gboolean should_be_mapped = client_window_should_be_mapped (window);
 
+  g_return_if_fail (!window->override_redirect);
+
   if (window->mapped == should_be_mapped)
     return;
 
@@ -1487,7 +1489,8 @@ meta_window_new (MetaDisplay   *display,
   /* disable show desktop mode unless we're a desktop component */
   maybe_leave_show_desktop_mode (window);
 
-  sync_client_window_mapped (window);
+  if (!window->override_redirect)
+    sync_client_window_mapped (window);
 
   meta_window_queue (window, META_QUEUE_CALC_SHOWING);
   /* See bug 303284; a transient of the given window can already exist, in which
@@ -2291,7 +2294,8 @@ implement_showing (MetaWindow *window,
   meta_verbose ("Implement showing = %d for window %s\n",
                 showing, window->desc);
 
-  sync_client_window_mapped (window);
+  if (!window->override_redirect)
+    sync_client_window_mapped (window);
 
   if (!showing)
     {


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