From b1ff50f45ff66b23806cd374a48931ad50008aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann?= Date: Tue, 7 Aug 2007 17:27:09 +0000 Subject: [PATCH] Don't maintain a passive grab on windows when raise-on-click is FALSE - MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tue Aug 7 13:26:49 2007 Søren Sandmann * src/window.c (meta_window_notify_focus): Don't maintain a passive grab on windows when raise-on-click is FALSE - bug 461577. svn path=/trunk/; revision=3293 --- src/window.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/window.c b/src/window.c index 71b28125e..fac38259a 100644 --- a/src/window.c +++ b/src/window.c @@ -5143,8 +5143,18 @@ meta_window_notify_focus (MetaWindow *window, /* Ungrab click to focus button since the sync grab can interfere * with some things you might do inside the focused window, by * causing the client to get funky enter/leave events. + * + * The reason we usually have a passive grab on the window is + * so that we can intercept clicks and raise the window in + * response. For click-to-focus we don't need that since the + * focused window is already raised. When raise_on_click is + * FALSE we also don't need that since we don't do anything + * when the window is clicked. + * + * There is dicussion in bugs 102209, 115072, and 461577 */ - if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK) + if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK || + !meta_prefs_get_raise_on_click()) meta_display_ungrab_focus_window_button (window->display, window); } } @@ -5183,8 +5193,9 @@ meta_window_notify_focus (MetaWindow *window, /* move out of FOCUSED_WINDOW layer */ meta_window_update_layer (window); - /* Re-grab for click to focus, if necessary */ - if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK) + /* Re-grab for click to focus and raise-on-click, if necessary */ + if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK || + !meta_prefs_get_raise_on_click ()) meta_display_grab_focus_window_button (window->display, window); } }