After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 620106 - Ability to Close Applications during Alt-Tab
Ability to Close Applications during Alt-Tab
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: app-switcher
3.16.x
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 633649 669277 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-05-30 16:50 UTC by Ustun
Modified: 2018-02-09 09:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[appSwitcher] Add shortcut to quit application (3.83 KB, patch)
2010-06-01 18:21 UTC, Florian Müllner
none Details | Review
[appSwitcher] Add shortcut to quit application (3.83 KB, patch)
2010-06-01 18:33 UTC, Florian Müllner
none Details | Review
[appSwitcher] Add shortcut to quit application (3.49 KB, patch)
2010-06-01 18:35 UTC, Florian Müllner
needs-work Details | Review
[appSwitcher] Add shortcut to quit application (7.14 KB, patch)
2010-06-06 02:16 UTC, Florian Müllner
none Details | Review
[appSwitcher] Add shortcut to quit application (6.54 KB, patch)
2017-12-04 23:13 UTC, Mario Sánchez Prada
none Details | Review
altTab: Use arrow functions for callbacks (7.30 KB, patch)
2017-12-04 23:13 UTC, Mario Sánchez Prada
none Details | Review
switcherPopup: Handle removal of items from SwitcherPopup (3.38 KB, patch)
2017-12-04 23:13 UTC, Mario Sánchez Prada
none Details | Review
altTab: Ensure no undefined objects are referenced after quitting an app (2.89 KB, patch)
2017-12-04 23:14 UTC, Mario Sánchez Prada
none Details | Review
altTab: Add also a shortcut to close windows from the WindowSwitcher (2.54 KB, patch)
2017-12-05 11:10 UTC, Mario Sánchez Prada
none Details | Review

Description Ustun 2010-05-30 16:50:06 UTC
When pressing Alt-Tab, user should have the ability to close apps without switching to the app. 

When the focus is on the app icon, the user should have the ability to press Alt-F4 to close the app. 

OS X provides this, one can press Command-Q during app switching. 

This provides the user a nice way to go over the working apps and close a bunch  of them in succession.
Comment 1 Florian Müllner 2010-06-01 15:38:28 UTC
(In reply to comment #0)
> When the focus is on the app icon, the user should have the ability to press
> Alt-F4 to close the app. 
> 
> OS X provides this, one can press Command-Q during app switching.

Sounds like a nice feature to me, though I don't agree with the proposed shortcut: Per default, Alt-F4 closes a window, while Ctrl-q is the usual way of closing an application. So despite the risk of being accused of shameless OS X plagiarism, I still think we should use the latter ;)

An implementation should probably wait for the GApplication stuff settling down though.
Comment 2 Colin Walters 2010-06-01 15:55:48 UTC
It's fine to call shell_app_quit now, and assume the implementation will get better over time.
Comment 3 Ustun 2010-06-01 16:12:17 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > When the focus is on the app icon, the user should have the ability to press
> > Alt-F4 to close the app. 
> > 
> > OS X provides this, one can press Command-Q during app switching.
> 
> Sounds like a nice feature to me, though I don't agree with the proposed
> shortcut: Per default, Alt-F4 closes a window, while Ctrl-q is the usual way of
> closing an application. So despite the risk of being accused of shameless OS X
> plagiarism, I still think we should use the latter ;)
> 
> An implementation should probably wait for the GApplication stuff settling down
> though.

Similarly, OS X allows hiding an app while Alt-Tab dialog is shown and this is useful as well. Since hiding is also an issue here, I have created a bug report on that one as well: https://bugzilla.gnome.org/show_bug.cgi?id=620270

This is again basically useful for decluttering the workspace, but unlike quit, this will allow the user to stash away currently unused applications' windows. Shall I open a new bug report for that one, or can these two be combined here?
Comment 4 Ustun 2010-06-01 16:15:07 UTC
> I don't agree with the proposed
> shortcut: Per default, Alt-F4 closes a window, while Ctrl-q is the usual way of
> closing an application. So despite the risk of being accused of shameless OS X
> plagiarism, I still think we should use the latter ;)
> 


Ctrl-q is more logical, but Alt-F4 is more convenient. User holds the Alt button during Alt-Tabbing, so maybe Alt-Q. But in that case, it would conflict with the usual gnome shortcut Ctrl-q. 

But we might get away with saying: This is the Alt-Tab dialog, so the prefix is always Alt here. :)
Comment 5 Florian Müllner 2010-06-01 18:21:26 UTC
Created attachment 162486 [details] [review]
[appSwitcher] Add shortcut to quit application

Allow to quit the currently selected application by hitting Ctrl-q,
similar to the OS X switcher.

(In reply to comment #2)
> It's fine to call shell_app_quit now, and assume the implementation will get
> better over time.

Duh - stupid me.


(In reply to comment #4)
> Ctrl-q is more logical, but Alt-F4 is more convenient. User holds the Alt
> button during Alt-Tabbing, so maybe Alt-Q. But in that case, it would conflict
> with the usual gnome shortcut Ctrl-q. 
> 
> But we might get away with saying: This is the Alt-Tab dialog, so the prefix is
> always Alt here. :)

Sounds like a good suggestion to me - as releasing Alt would close the popup, using Ctrl-q actually becomes Alt-Ctrl-q, which is a pretty awful shortcut.

I still used Ctrl-q for the current patch until further design input - changing the shortcut is trivial though, the hard part is updating the icon list ...


Also, the patch does only deal with the appSwitcher popup, not the window thumbnails - for the latter, we'll probably want two shortcuts, one for closing the selected window and another one for closing its app.
Comment 6 Florian Müllner 2010-06-01 18:33:50 UTC
Created attachment 162487 [details] [review]
[appSwitcher] Add shortcut to quit application

(In reply to comment #4)
> But we might get away with saying: This is the Alt-Tab dialog, so the prefix is
> always Alt here. :)

Mmmh, this patch uses Alt-q. It is waaaaaay more convenient, but I'm not sure that's a good thing after all - the popup already has bindings for TAB, w, a, s and d, which makes hitting Alt-q accidentally pretty likely ...
Comment 7 Florian Müllner 2010-06-01 18:35:06 UTC
Created attachment 162488 [details] [review]
[appSwitcher] Add shortcut to quit application

Wooops, wrong patch
Comment 8 drago01 2010-06-01 22:27:40 UTC
Review of attachment 162488 [details] [review]:

Overall looks good and seems to work fine, there is a inconsistency between the commit message and a bug though.

::: js/ui/altTab.js
@@ +242,3 @@
             else if (keysym == Clutter.Down || keysym == Clutter.s)
                 this._select(this._currentApp, 0);
+            else if (keysym == Clutter.q)

So you lied in the commit message ;) ... this is not Ctrl-q but actually Alt-q

@@ +978,3 @@
+    },
+
+    _onDestroy: function() {

You'd have to destroy the thumbnail box too (in case it is present).

Just open two terminal windows and close gnome-terminal using Alt-q and see what happens.
Comment 9 drago01 2010-06-01 22:45:52 UTC
(In reply to comment #6)
> Created an attachment (id=162487) [details] [review]
> [appSwitcher] Add shortcut to quit application
> 
> (In reply to comment #4)
> > But we might get away with saying: This is the Alt-Tab dialog, so the prefix is
> > always Alt here. :)
> 
> Mmmh, this patch uses Alt-q. It is waaaaaay more convenient, but I'm not sure
> that's a good thing after all - the popup already has bindings for TAB, w, a, s
> and d, which makes hitting Alt-q accidentally pretty likely ...

Hmm... good point. 
Hitting q instead of a or w is quite easy ...
Comment 10 Owen Taylor 2010-06-01 22:56:19 UTC
Note that w/a/s are just "easter eggs" that Dan added because arrow keys didn't work within Xephyr.
Comment 11 drago01 2010-06-02 07:54:04 UTC
(In reply to comment #10)
> Note that w/a/s are just "easter eggs" that Dan added because arrow keys didn't
> work within Xephyr.

Yeah but I use them all the time because they are easier to reach with the same hand than the arrow keys (for the arrow keys you need your second hand at least on almost all keyboards)
Comment 12 Dan Winship 2010-06-02 08:51:26 UTC
it seems to me like the existence of this feature in OS X is just a workaround for the fact that in OS X you very very very frequently end up with apps still running after you're done with them (either entirely accidentally, or because you intentionally left it running after closing its last window "just in case") and then it's not until some time later, when you're Alt-Tabbing to another app, that you notice that the earlier app is still running and using up memory that you didn't intend it to be using.
Comment 13 Florian Müllner 2010-06-06 02:16:51 UTC
Created attachment 162841 [details] [review]
[appSwitcher] Add shortcut to quit application

(In reply to comment #8)
> So you lied in the commit message ;) ... this is not Ctrl-q but actually Alt-q

My, evil me ... yup, changed the shortcut, forgot the commit message :(
Comment 14 Dan Winship 2010-06-08 20:11:06 UTC
Comment on attachment 162841 [details] [review]
[appSwitcher] Add shortcut to quit application

Parts of this patch are needed regardless of whether or not we keep the Alt-q behavior: it's already possible for a window or app to go away while the switcher is up (eg, if you tell an app to quit, and then immediately do Alt-Tab, but it takes the app a second or two to save its state and exit). It would be good to split out the "dealing with things going away" parts from the Alt-q parts.

(We don't need to deal with things being added, since we used a cached list of apps and windows, although we *could* if we really wanted to...)

>+            else if (keysym == Clutter.q)
>+                this._appIcons[this._currentApp].app.request_quit();

>+            else if (keysym == Clutter.q)
>+                this._appIcons[this._currentApp].app.request_quit();

you don't need to do it twice, just put it before the _thumbnailsFocused split, along with grave and Escape.

>+    removeItem: function(index) {
>+        let item = this._items.splice(index, 1);
>+        item[0].destroy();
>+    },

this is maybe tolerable for the app-randomly-unexpectedly-exited case, but if we're actually supporting Alt-q, it seems like we ought to tween here rather than abruptly removing the icon.

Actually... it's probably even worse for the the app-randomly-unexpectedly-exited case, since the user isn't expecting the icon to disappear in that case, and so will have even less context as to what just abruptly changed...
Comment 15 Jay Ellington 2010-10-01 15:33:26 UTC
How about something a bit different. Instead of having a keyboard shortcut we
could have a close button [x] hovering over the upper right of the applications
icon in the alt-tab switcher that is similar to the close button on the windows
when you go into the activities switcher.
Comment 16 William Jon McCann 2010-10-01 15:38:27 UTC
In the last few weeks I've noticed a few times where I was alt-tabbing and realized there was an app there that I forgot to quit.  It would indeed have been nice to take that opportunity to do so.  Alt+Q seems to be the better choice to me.
Comment 17 Florian Müllner 2010-10-01 15:55:07 UTC
First, sorry for not updating that patch - I got stuck handling destroyed windows and moved on to other stuff :(

I'll get to it eventually, promise!


(In reply to comment #16)
> In the last few weeks I've noticed a few times where I was alt-tabbing and
> realized there was an app there that I forgot to quit.  It would indeed have
> been nice to take that opportunity to do so.  Alt+Q seems to be the better
> choice to me.

Once we handle stuff going away during Alt-tab, it is easy to add the shortcut. I just wanted to mention that this feature will conflict with the request in bug 625649, so we'll have to decide what's more important to us.
Comment 18 jorchube 2011-04-03 18:34:22 UTC
Finally, what happened to this request? Is it implemented? rejected? postposed?

I'm using gnome 2.91.93 in Archlinux, and, well, I really think that would be nice to have this alt+q shortcut in the alt-tab popup.


regards and congratulations for the upcoming release ;)
Comment 19 Jasper St. Pierre (not reading bugmail) 2012-05-21 23:25:56 UTC
Do we still want this?
Comment 20 Bastien Nocera 2012-05-22 08:25:47 UTC
(In reply to comment #19)
> Do we still want this?

Yes!
Comment 21 Denis Donici 2014-04-01 17:48:32 UTC
Absolutely!
Comment 22 Florian Müllner 2015-02-27 21:00:12 UTC
*** Bug 633649 has been marked as a duplicate of this bug. ***
Comment 23 Florian Müllner 2015-02-27 21:00:20 UTC
*** Bug 669277 has been marked as a duplicate of this bug. ***
Comment 24 Juraj Fiala 2015-07-31 05:36:00 UTC
Yes yes yes!

BTW,

(In reply to Florian Müllner from comment #6)
> Mmmh, this patch uses Alt-q. It is waaaaaay more convenient, but I'm not
> sure that's a good thing after all - the popup already has bindings for TAB,
> w, a, s and d, which makes hitting Alt-q accidentally pretty likely ...

What about the user having to press Q twice, with the app icon starting to wobble and the background turning red and an X in  of the corner on the first time?
Comment 25 Juraj Fiala 2015-07-31 05:37:12 UTC
Also (forgot to ask, can't edit), Alt-Tab and the Alt-WASD doesn't do anything for me, but seems cool.
Comment 26 Denis Donici 2015-10-15 01:46:29 UTC
Im not a coder, but its a shame that after five years this feature is still not implemented. Take example from Openbox
Comment 27 Sri Ramkrishna 2015-10-16 15:51:16 UTC
Hiya Denis, I think it is one of those things where other things have taken more priority.  Clearly there are people who want this including core GNOME people.  The first step might be to talk with designers on how best to implement this with  the current design of GNOME.  It might even be worthy of an extension.  If you want to help champion this, please visit #gnome-design and bring up the bug.  You might not get an immediate reply, but something will happen. :)
Comment 28 Mario Sánchez Prada 2017-11-30 21:28:23 UTC
FWIW, I've been taking a look to this one and, surprisingly, Florian's patch still applies quite nicely on the current codebase.

I still can see a few issues, specially when closing apps with the windows' thumbnails open, so I'll try to iron those out before proposing a review.

In the meantime, here is the WIP branch: https://git.gnome.org/browse/gnome-shell/log/?h=wip/msanchez/620106
Comment 29 Mario Sánchez Prada 2017-12-04 23:13:16 UTC
Created attachment 364956 [details] [review]
[appSwitcher] Add shortcut to quit application

Allow to quit the currently selected application by hitting Alt-q,
similar to the OS X switcher.
Comment 30 Mario Sánchez Prada 2017-12-04 23:13:36 UTC
Created attachment 364957 [details] [review]
altTab: Use arrow functions for callbacks
Comment 31 Mario Sánchez Prada 2017-12-04 23:13:49 UTC
Created attachment 364958 [details] [review]
switcherPopup: Handle removal of items from SwitcherPopup

This will be mainly useful for closing apps from the applications
switcher, but can be implemented generically enough to select the
nearest existing item after removal if there's any, or destroying
the popup's actor otherwise.

Specifically for the apps switcher, doing this also removes the need
of having to manually either update the current app in AppSwitcher
and highlight it, if there are still any items after the removal, or
simply destroy the AppSwitcher otherwise. Besides, calling _select()
in the handler for item-removed makes sure that the list of thumbnails
in the switcher is always closed, if open, when quitting the app.
Comment 32 Mario Sánchez Prada 2017-12-04 23:14:07 UTC
Created attachment 364959 [details] [review]
altTab: Ensure no undefined objects are referenced after quitting an app

Add a few extra checks to prevent hitting undefined items when destroying
the list of thumbnails (if any) and selecting a new application after
quitting an application right from the switcher.
Comment 33 Mario Sánchez Prada 2017-12-04 23:16:43 UTC
@Florian, @anyone: I think this is ready for review. I started porting your patch on top of the latest master and then only a few additional fixes seem to be needed to have it working.

Please let me know what you think. Even better, test it! :)
Comment 34 Bastien Nocera 2017-12-04 23:27:02 UTC
Does this also work with Windows+Tab? What happens if either of those are redefined?
Comment 35 Mario Sánchez Prada 2017-12-05 08:59:10 UTC
(In reply to Bastien Nocera from comment #34)
> Does this also work with Windows+Tab?

I assume you mean the "Switch Windows" operation, in which case the answer is "no, it doesn't". But I can't see why I could not extend the set of patches to cover that as well

> What happens if either of those are redefined?

The way this has been done has been by checking whether the user has pressed the Q key while in the "Switch applications" mode, which you enter with whatever keybinding you have defined[1], so it works regardless of whether you have redefined them or not: as long as you press the Q key while in that mode, you request the app to quit.

[1] https://git.gnome.org/browse/gnome-shell/tree/js/ui/altTab.js?id=6e3178d5b6f070599f918acdc290caed9f29e37c#n159
Comment 36 Mario Sánchez Prada 2017-12-05 11:10:36 UTC
Created attachment 365019 [details] [review]
altTab: Add also a shortcut to close windows from the WindowSwitcher

This allows closing windows pressing Q while operating the window
switcher popup, similar to what has been done for the apps switcher.
Comment 37 Denis Donici 2017-12-06 04:31:45 UTC
Awesome, Mario. Hopewell this will get approved. Thank you
Comment 38 Mario Sánchez Prada 2018-01-22 11:42:18 UTC
Found this ticket today while going through my TODO list. @Florian, is there anything else I can do to get this one moving?
Comment 39 Mario Sánchez Prada 2018-02-01 16:07:48 UTC
Ping? @Florian, let me know if you want me to move this one to gitlab and propose a MR there, thanks
Comment 40 Mario Sánchez Prada 2018-02-05 11:52:44 UTC
Closing this bug after migrating it to gitlab, where it should be easier to do the review of the multiple-patch changeset.

Let's continue in https://gitlab.gnome.org/GNOME/gnome-shell/issues/23
Comment 41 Mario Sánchez Prada 2018-02-09 09:41:04 UTC
Quick note here to let people know this has landed in master:
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/16