[mutter] Avoid confusion when _NET_WM_USER_TIME_WINDOW is in the window stack



commit ed9d7f18a622f568c2cb47ed339f4994d7eaf96f
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Sep 16 14:45:53 2010 -0400

    Avoid confusion when _NET_WM_USER_TIME_WINDOW is in the window stack
    
    Wine sets _NET_WM_USER_TIME_WINDOW to point to an unmapped toplevel;
    this was causing much confusion because both the real window and
    the unmapped window were in the window stack and mapped back to the
    same MetaWindow.
    
    Debugged by Alban Browaeys
    https://bugzilla.gnome.org/show_bug.cgi?id=593887

 src/core/stack-tracker.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c
index 07517d8..c830fbb 100644
--- a/src/core/stack-tracker.c
+++ b/src/core/stack-tracker.c
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include "frame-private.h"
 #include "screen-private.h"
 #include "stack-tracker.h"
 #include "util.h"
@@ -682,7 +683,15 @@ meta_stack_tracker_sync_stack (MetaStackTracker *tracker)
 
       meta_window = meta_display_lookup_x_window (tracker->screen->display,
                                                   windows[i]);
-      if (meta_window)
+      /* When mapping back from xwindow to MetaWindow we have to be a bit careful;
+       * children of the root could include unmapped windows created by toolkits
+       * for internal purposes, including ones that we have registered in our
+       * XID => window table. (Wine uses a toplevel for _NET_WM_USER_TIME_WINDOW;
+       * see window-prop.c:reload_net_wm_user_time_window() for registration.)
+       */
+      if (meta_window &&
+          (windows[i] == meta_window->xwindow ||
+           (meta_window->frame && windows[i] == meta_window->frame->xwindow)))
         meta_windows = g_list_prepend (meta_windows, meta_window);
     }
 



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