[gnome-shell] altTab: Move input focus to target window before dropping the grab



commit bf02cde598e0d6b9dfb7913128c2260250b4ac2d
Author: Rui Matos <tiagomatos gmail com>
Date:   Fri Mar 22 16:21:18 2013 +0100

    altTab: Move input focus to target window before dropping the grab
    
    We chain up on _finish() to drop the grab and destroy the switcher
    popup but we should activate the target window first because dropping
    the grab results in the previously focused windows getting a focus in
    event immediately followed by the focus out event from the target
    window activation which we can easily avoid.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696259

 js/ui/altTab.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index d6f6a95..4b62f5c 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -232,11 +232,11 @@ const AppSwitcherPopup = new Lang.Class({
     },
 
     _finish : function(timestamp) {
-        this.parent();
-
         let appIcon = this._items[this._selectedIndex];
         let window = this._currentWindow > 0 ? this._currentWindow : 0;
         appIcon.app.activate_window(appIcon.cachedWindows[window], timestamp);
+
+        this.parent();
     },
 
     _onDestroy : function() {
@@ -395,9 +395,9 @@ const WindowSwitcherPopup = new Lang.Class({
     },
 
     _finish: function() {
-        this.parent();
-
         Main.activateWindow(this._items[this._selectedIndex].window);
+
+        this.parent();
     }
 });
 


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