[metacity] window: properly handle focusing override redirect windows



commit 9b8407d40f1fa4998b912bf34bb0e6d5f8201115
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed May 1 17:37:50 2013 -0400

    window: properly handle focusing override redirect windows
    
    If an app pops up an OR window and sets input focus to it, like
    Steam does, we'll think the focus window is null, causing us to
    think the app is not focused.
    
    OR windows should not be special if they get input focus, where
    the input focus would be set to NULL. Instead, the window should
    be marked as focused.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647706

 src/core/display.c |    6 +-----
 src/core/window.c  |    8 ++++++--
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 9c0bbde..5b26de3 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1564,11 +1564,7 @@ handle_window_focus_event (MetaDisplay *display,
     {
       display->server_focus_window = event->xany.window;
       display->server_focus_serial = event->xfocus.serial;
-
-      if (window && window->override_redirect)
-        focus_window = NULL;
-      else
-        focus_window = window;
+      focus_window = window;
     }
   else if (event->type == FocusOut)
     {
diff --git a/src/core/window.c b/src/core/window.c
index 20cf474..14d76fc 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -5749,6 +5749,8 @@ meta_window_set_focused_internal (MetaWindow *window,
   if (focused)
     {
       window->has_focus = TRUE;
+      if (window->override_redirect)
+        return;
 
       /* Move to the front of the focusing workspace's MRU list.
        * We should only be "removing" it from the MRU list if it's
@@ -5810,9 +5812,11 @@ meta_window_set_focused_internal (MetaWindow *window,
     }
   else
     {
-      meta_window_propagate_focus_appearance (window, FALSE);
-
       window->has_focus = FALSE;
+      if (window->override_redirect)
+        return;
+
+      meta_window_propagate_focus_appearance (window, FALSE);
 
       if (!window->attached_focus_window)
         meta_window_appears_focused_changed (window);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]