diff options
-rw-r--r-- | Apply-new_windows_always_on_top-to-newly-raised-acti.patch | 112 | ||||
-rw-r--r-- | Exclude-the-current-application-from-no_focus_window.patch | 68 | ||||
-rw-r--r-- | metacity.spec | 4 |
3 files changed, 182 insertions, 2 deletions
diff --git a/Apply-new_windows_always_on_top-to-newly-raised-acti.patch b/Apply-new_windows_always_on_top-to-newly-raised-acti.patch new file mode 100644 index 0000000..7df74fb --- /dev/null +++ b/Apply-new_windows_always_on_top-to-newly-raised-acti.patch @@ -0,0 +1,112 @@ +From c093802679a2232a115da35e8d3a3cfefef0e6dd Mon Sep 17 00:00:00 2001 +From: Owen W. Taylor <otaylor@fishsoup.net> +Date: Wed, 23 Jun 2010 19:45:05 -0400 +Subject: [PATCH 2/2] Apply new_windows_always_on_top to newly raised/activated windows + +A window that raises itself or activates itself is in many ways +like a completely new window. (Once a window is out of the user's +site, they really have no idea if it's mapped or has been withdrawn +by the user.) + +If the user has set the new_windows_always_on_top key to make the +behavior for a focus-stealing-prevented *new* window "raise but not +focus", then they'll want the same behavior in the case of +windows that attempt to raise or activate themselves as well. + +https://bugzilla.gnome.org/show_bug.cgi?id=599261 +--- + src/core/window.c | 35 +++++++++++++++++++++++++++++++---- + src/metacity.schemas.in.in | 6 ++++++ + 2 files changed, 37 insertions(+), 4 deletions(-) + +diff --git a/src/core/window.c b/src/core/window.c +index 399bb42..c51cdec 100644 +--- a/src/core/window.c ++++ b/src/core/window.c +@@ -3000,6 +3000,8 @@ window_activate (MetaWindow *window, + MetaWorkspace *workspace) + { + gboolean can_ignore_outdated_timestamps; ++ gboolean only_raise = FALSE; ++ + meta_topic (META_DEBUG_FOCUS, + "_NET_ACTIVE_WINDOW message sent for %s at time %u " + "by client type %u.\n", +@@ -3021,8 +3023,28 @@ window_activate (MetaWindow *window, + "last_user_time (%u) is more recent; ignoring " + " _NET_ACTIVE_WINDOW message.\n", + window->display->last_user_time); +- meta_window_set_demands_attention(window); +- return; ++ if (meta_prefs_get_new_windows_always_on_top () && ++ meta_prefs_get_raise_on_click ()) ++ { ++ /* The new_windows_only_on_top preference causes new ++ * focus-denied windows to get raised but not focused ++ * instead of set to demands attention. For consistency, we ++ * do the same here with windows that are "new to the user" ++ * - that self activate and are focus-stealing prevented. We ++ * can't just raise the window and return here because the ++ * window might be on a different workspace, so we need the ++ * handling below. The check for meta_prefs_get_raise_on_click () ++ * is because that preference, if off, somewhat unexpectedl ++ * akes windows not raise on self-activation. If that is changed ++ * than the test should be removed here. ++ */ ++ only_raise = TRUE; ++ } ++ else ++ { ++ meta_window_set_demands_attention (window); ++ return; ++ } + } + + /* For those stupid pagers, get a valid timestamp and show a warning */ +@@ -3071,7 +3093,8 @@ window_activate (MetaWindow *window, + meta_topic (META_DEBUG_FOCUS, + "Focusing window %s due to activation\n", + window->desc); +- meta_window_focus (window, timestamp); ++ if (!only_raise) ++ meta_window_focus (window, timestamp); + } + + /* This function exists since most of the functionality in window_activate +@@ -4796,11 +4819,15 @@ meta_window_configure_request (MetaWindow *window, + "broken behavior and the request is being ignored.\n", + window->desc); + } ++ /* the new_windows_always_on_top check is because a window that ++ * spontaneously restacks itself to the top is a lot like a new ++ * window that doesn't get focus */ + else if (active_window && + !meta_window_same_application (window, active_window) && + !meta_window_same_client (window, active_window) && + XSERVER_TIME_IS_BEFORE (window->net_wm_user_time, +- active_window->net_wm_user_time)) ++ active_window->net_wm_user_time) && ++ !meta_prefs_get_new_windows_always_on_top ()) + { + meta_topic (META_DEBUG_STACK, + "Ignoring xconfigure stacking request from %s (with " +diff --git a/src/metacity.schemas.in.in b/src/metacity.schemas.in.in +index e0dec3d..b8257c4 100644 +--- a/src/metacity.schemas.in.in ++++ b/src/metacity.schemas.in.in +@@ -193,6 +193,12 @@ + invariant in the 'click' focus mode that the topmost window always + has focus, so its most suitable for use with the 'mouse' and + 'sloppy' focus modes. ++ ++ This key also affects windows that try to activate or raise themselves ++ themselves but don't succeed in getting the the focus. Without ++ this key being set, such windows are flashed in the taskbar. With ++ this key set they, like entirely new windows, are raised but not ++ focused. + </long> + </locale> + </schema> +-- +1.7.0.1 + diff --git a/Exclude-the-current-application-from-no_focus_window.patch b/Exclude-the-current-application-from-no_focus_window.patch new file mode 100644 index 0000000..22f9f56 --- /dev/null +++ b/Exclude-the-current-application-from-no_focus_window.patch @@ -0,0 +1,68 @@ +From 10c92eeae2fb4130cade27e1c2d631ef00019a2c Mon Sep 17 00:00:00 2001 +From: Owen W. Taylor <otaylor@fishsoup.net> +Date: Wed, 23 Jun 2010 16:49:37 -0400 +Subject: [PATCH 1/2] Exclude the current application from no_focus_windows setting + +The idea of the no_focus_windows setting is to allow identifying +legacy application windows that are stealing focus from other +applications and suppress that behavior. Sometimes its not possible to +identify specific problem windows of an application and its +necessary to blanket add all windows of the application. In this +case no_focus_windows can disrupt the internal flow of focus +within the application. + +On the assumption that apps internally handle focus correctly +and have been tested not to steal focus from themselves at +annoying times, we exclude windows of the the current application +from no_focus_windows. + +https://bugzilla.gnome.org/show_bug.cgi?id=599248 +--- + src/core/window.c | 11 ++++++++++- + src/metacity.schemas.in.in | 3 +++ + 2 files changed, 13 insertions(+), 1 deletions(-) + +diff --git a/src/core/window.c b/src/core/window.c +index cacc3eb..399bb42 100644 +--- a/src/core/window.c ++++ b/src/core/window.c +@@ -1977,12 +1977,21 @@ window_state_on_map (MetaWindow *window, + gboolean *places_on_top) + { + gboolean intervening_events; ++ MetaWindow *focus_window; + + /* A 'no focus' window is a window that has been configured in GConf + * to never take focus on map; typically it will be a notification + * window from a legacy app that doesn't support _NET_WM_USER_TIME. ++ * ++ * This doesn't apply to applications taking focus from themselves; ++ * the assumption is applications have been properly tested to internally ++ * handle focus properly. + */ +- if (meta_prefs_window_is_no_focus (window->title, window->res_class)) ++ focus_window = window->display->focus_window; ++ if (focus_window && ++ !meta_window_same_application (window, focus_window) && ++ !meta_window_same_client (window, focus_window) && ++ meta_prefs_window_is_no_focus (window->title, window->res_class)) + intervening_events = TRUE; + else + intervening_events = intervening_user_event_occurred (window); +diff --git a/src/metacity.schemas.in.in b/src/metacity.schemas.in.in +index c42fa96..e0dec3d 100644 +--- a/src/metacity.schemas.in.in ++++ b/src/metacity.schemas.in.in +@@ -123,6 +123,9 @@ + WM_CLASS matches the shell-style glob pattern <glob>. + (and <expr> <expr>) (or <expr> <expr>) (not <expr): Boolean combinations + of expressions. ++ ++ New windows from the current active application are unaffected by ++ this setting. + </long> + </locale> + </schema> +-- +1.7.0.1 + diff --git a/metacity.spec b/metacity.spec index 9a25851..9fb940b 100644 --- a/metacity.spec +++ b/metacity.spec @@ -3,7 +3,7 @@ Summary: Unobtrusive window manager Name: metacity Version: 2.30.0 -Release: 4%{?dist} +Release: 5%{?dist} URL: http://download.gnome.org/sources/metacity/ Source0: http://download.gnome.org/sources/metacity/2.30/metacity-%{version}.tar.bz2 # http://bugzilla.gnome.org/show_bug.cgi?id=558723 @@ -240,7 +240,7 @@ fi %{_mandir}/man1/metacity-window-demo.1.gz %changelog -* Wed Jun 9 2010 Owen Taylor <otaylor@redhat.com> - 2.30.0-4 +* Wed Jun 9 2010 Owen Taylor <otaylor@redhat.com> - 2.30.0-5 - Add a patch to fix confusion between windows (rhbz #533066) - Add additional tweeks no_focus_windows and new_windows_always_on_top preferences (gnome bz 599248, gnome bz 599261) |