summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Sanchez Prada <mario@endlessm.com>2017-12-01 20:40:41 +0000
committerMario Sanchez Prada <mario@endlessm.com>2017-12-01 21:30:26 +0000
commit043f042cec32eec259f4f3505670a62788331b85 (patch)
tree3c6777276d4e425f2eb2d6ab29a0d38c1bd3353f
parent815302b4ac74e84e766c49efd1ec78c2731f5d44 (diff)
downloadgnome-shell-wip/msanchez/620106.tar.gz
altTab: Close the list of thumbnails in the switcher when closing an appwip/msanchez/620106
This makes sure that no thumbnails list is left open and empty, since both the app's icon and all its thumbnails will be gone once the app is closed. https://bugzilla.gnome.org/show_bug.cgi?id=620106
-rw-r--r--js/ui/altTab.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index 3a70c84a4..97bfe66e2 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -156,6 +156,17 @@ var AppSwitcherPopup = new Lang.Class({
this._items[this._selectedIndex].cachedWindows.length);
},
+ _quitApplication: function(appIndex) {
+ let appIcon = this._items[appIndex];
+ if (!appIcon)
+ return;
+
+ // Make sure the list of thumbnails is hidden before quitting the
+ // application, not to keep an empty list of windows showing up.
+ this._select(appIndex, null, false);
+ appIcon.app.request_quit();
+ },
+
_keyPressHandler: function(keysym, action) {
if (action == Meta.KeyBindingAction.SWITCH_GROUP) {
if (!this._thumbnailsFocused)
@@ -176,7 +187,7 @@ var AppSwitcherPopup = new Lang.Class({
else if (keysym == Clutter.Up)
this._select(this._selectedIndex, null, true);
else if (keysym == Clutter.q)
- this._items[this._selectedIndex].app.request_quit();
+ this._quitApplication(this._selectedIndex);
else
return Clutter.EVENT_PROPAGATE;
} else {
@@ -187,7 +198,7 @@ var AppSwitcherPopup = new Lang.Class({
else if (keysym == Clutter.Down)
this._select(this._selectedIndex, 0);
else if (keysym == Clutter.q)
- this._items[this._selectedIndex].app.request_quit();
+ this._quitApplication(this._selectedIndex);
else
return Clutter.EVENT_PROPAGATE;
}