summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2005-02-06 17:01:41 +0000
committerElijah Newren <newren@src.gnome.org>2005-02-06 17:01:41 +0000
commit459c6668fbfc1d3d5983b4cf96b384c5a682ca35 (patch)
tree3d845541c8b8d78fbcb9514de852241b3abce5da
parentd11681e5050b9ddf37d211f09c07557bef374277 (diff)
downloadmetacity-459c6668fbfc1d3d5983b4cf96b384c5a682ca35.tar.gz
Ignore xconfigurerequest events for stacking when it should be safe to do
2005-02-06 Elijah Newren <newren@gmail.com> 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.
-rw-r--r--ChangeLog13
-rw-r--r--src/window.c48
2 files changed, 50 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 139ef47f..e269a2e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2005-02-06 Elijah Newren <newren@gmail.com>
+ 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 <newren@gmail.com>
+
If activation requests are too old, set the demands_attention hint
instead of actually activating. Thanks to Crispin Flowerday for
the test case and for testing the patch. Fixes half of #166395.
diff --git a/src/window.c b/src/window.c
index 083a439a..529327d2 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;
+ }
}
}