[gnome-shell/issue-23: 41/43] altTab: Add shortcut to quit application



commit 1dc8e940fba735b7cf0a1c723e6422f4ec9a4a76
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jun 1 20:03:45 2010 +0200

    altTab: Add shortcut to quit application
    
    Allow to quit the currently selected application by hitting Alt-q,
    similar to the OS X switcher.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=620106

 js/ui/altTab.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index a10e1433e..80039cba5 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -156,6 +156,14 @@ var AppSwitcherPopup = new Lang.Class({
                                  this._items[this._selectedIndex].cachedWindows.length);
     },
 
+    _quitApplication: function(appIndex) {
+        let appIcon = this._items[appIndex];
+        if (!appIcon)
+            return;
+
+        appIcon.app.request_quit();
+    },
+
     _keyPressHandler: function(keysym, action) {
         if (action == Meta.KeyBindingAction.SWITCH_GROUP) {
             if (!this._thumbnailsFocused)
@@ -168,6 +176,8 @@ var AppSwitcherPopup = new Lang.Class({
             this._select(this._next());
         } else if (action == Meta.KeyBindingAction.SWITCH_APPLICATIONS_BACKWARD) {
             this._select(this._previous());
+        } else if (keysym == Clutter.q) {
+            this._quitApplication(this._selectedIndex);
         } else if (this._thumbnailsFocused) {
             if (keysym == Clutter.Left)
                 this._select(this._selectedIndex, this._previousWindow());


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