[gnome-shell] ctrlAltTab: Only set the stage focus mode when we're focusing a widget



commit a171e92e6c4781fbeb7c90af7c1f71ccd42e807e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Oct 2 19:21:28 2012 -0300

    ctrlAltTab: Only set the stage focus mode when we're focusing a widget
    
    This ensures that we don't accidentally lose focus when switching to
    the message tray.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684633

 js/ui/ctrlAltTab.js |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/ctrlAltTab.js b/js/ui/ctrlAltTab.js
index bd9bb14..0519c99 100644
--- a/js/ui/ctrlAltTab.js
+++ b/js/ui/ctrlAltTab.js
@@ -54,16 +54,17 @@ const CtrlAltTabManager = new Lang.Class({
     },
 
     focusGroup: function(item) {
-        if (global.stage_input_mode == Shell.StageInputMode.NONREACTIVE ||
-            global.stage_input_mode == Shell.StageInputMode.NORMAL)
-            global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
-
-        if (item.window)
+        if (item.window) {
             Main.activateWindow(item.window);
-        else if (item.focusCallback)
+        } else if (item.focusCallback) {
             item.focusCallback();
-        else
+        } else {
+            if (global.stage_input_mode == Shell.StageInputMode.NONREACTIVE ||
+                global.stage_input_mode == Shell.StageInputMode.NORMAL)
+                global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
+
             item.root.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
+        }
     },
 
     // Sort the items into a consistent order; panel first, tray last,



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