From ed9d7f18a622f568c2cb47ed339f4994d7eaf96f Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 16 Sep 2010 14:45:53 -0400 Subject: [PATCH] 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 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c index 07517d81c..c830fbbb9 100644 --- a/src/core/stack-tracker.c +++ b/src/core/stack-tracker.c @@ -23,6 +23,7 @@ #include +#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); }