From d11681e5050b9ddf37d211f09c07557bef374277 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sun, 6 Feb 2005 16:52:26 +0000 Subject: [PATCH] If activation requests are too old, set the demands_attention hint instead 2005-02-06 Elijah Newren 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. * src/window.c: (meta_window_activate): if the request came before the last focus time, set the demands attention hint instead --- ChangeLog | 9 +++++++++ src/window.c | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index e8d3e9115..139ef47f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-02-06 Elijah Newren + + 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. + + * src/window.c: (meta_window_activate): if the request came before + the last focus time, set the demands attention hint instead + 2005-02-04 Dave Ahlswede * src/metacity.schemas.in: Add period to the end of diff --git a/src/window.c b/src/window.c index 8317dd788..083a439a8 100644 --- a/src/window.c +++ b/src/window.c @@ -2155,6 +2155,20 @@ void meta_window_activate (MetaWindow *window, guint32 timestamp) { + /* Older EWMH spec didn't specify a timestamp, so it can be 0 and we + * have to treat that as a new request. + */ + if (XSERVER_TIME_IS_BEFORE (timestamp, window->display->last_focus_time) && + timestamp != 0) + { + meta_topic (META_DEBUG_FOCUS, + "_NET_ACTIVE_WINDOW message sent but with a timestamp that" + "requests the window not be active, so we're ignoring it.\n"); + window->wm_state_demands_attention = TRUE; + set_net_wm_state (window); + return; + } + if (timestamp != 0) window->net_wm_user_time = timestamp;