From 459c6668fbfc1d3d5983b4cf96b384c5a682ca35 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sun, 6 Feb 2005 17:01:41 +0000 Subject: [PATCH] Ignore xconfigurerequest events for stacking when it should be safe to do 2005-02-06 Elijah Newren Ignore xconfigurerequest events for stacking when it should be safe to do so. Again, thanks to Crispin Flowerday for the test case. Thanks to KWin for the inspiration (and to Google for indexing their source code). Fixes the other half of #166395. * src/window.c: (meta_window_configure_request): if the active_window is from a separate application than the one getting the configure request and the net_wm_user_time of the active window is later than that of the window getting the configure request, then ignore the request. --- ChangeLog | 13 +++++++++++++ src/window.c | 48 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 139ef47f3..e269a2e3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2005-02-06 Elijah Newren + + Ignore xconfigurerequest events for stacking when it should be + safe to do so. Again, thanks to Crispin Flowerday for the test + case. Thanks to KWin for the inspiration (and to Google for + indexing their source code). Fixes the other half of #166395. + + * src/window.c: (meta_window_configure_request): if the + active_window is from a separate application than the one getting + the configure request and the net_wm_user_time of the active + window is later than that of the window getting the configure + request, then ignore the request. + 2005-02-06 Elijah Newren If activation requests are too old, set the demands_attention hint diff --git a/src/window.c b/src/window.c index 083a439a8..529327d23 100644 --- a/src/window.c +++ b/src/window.c @@ -3820,18 +3820,44 @@ meta_window_configure_request (MetaWindow *window, */ if (event->xconfigurerequest.value_mask & CWStackMode) { - switch (event->xconfigurerequest.detail) + MetaWindow *active_window; + active_window = window->display->expected_focus_window; + if (meta_prefs_get_disable_workarounds ()) { - case Above: - meta_window_raise (window); - break; - case Below: - meta_window_lower (window); - break; - case TopIf: - case BottomIf: - case Opposite: - break; + meta_topic (META_DEBUG_STACK, + "%s sent an xconfigure stacking request; this is " + "broken behavior and the request is being ignored.\n", + window->desc); + } + else if (active_window && + !meta_window_same_application (window, active_window) && + XSERVER_TIME_IS_BEFORE (window->net_wm_user_time, + active_window->net_wm_user_time)) + { + meta_topic (META_DEBUG_STACK, + "Ignoring xconfigure stacking request from %s (with " + "user_time %lu); currently active application is %s (with " + "user_time %lu).\n", + window->desc, + window->net_wm_user_time, + active_window->desc, + active_window->net_wm_user_time); + } + else + { + switch (event->xconfigurerequest.detail) + { + case Above: + meta_window_raise (window); + break; + case Below: + meta_window_lower (window); + break; + case TopIf: + case BottomIf: + case Opposite: + break; + } } }