Quit applications while switching with alt + tab?
Solution 1:
If you have pushed alt + tab
, you should see something like this:
If you select the program you wish to close and then release tab
and press ~
it will open a smaller version of the application in the switcher and it will display the X in the top left corner as such:
If you click the X it will close the program.
Solution 2:
Simply press Q instead of Tab, while you are holding Alt.
(verified in Ubuntu 16.04 so far)
Details:
You are holding Alt while you press Tab repeatedly to switch to different apps. The thumbnail display of apps is the app switcher, and it won't disappear until you release Alt. Once the app you desire is highlighted, if you press Q, the switcher will send that app an "Alt+Q" command, and the app will close. You can then continue to Alt+Tab to another app, and repeat if needed.
Notes:
There are some apps like Sublime 2 that do not properly respect the request for close, and only the application window will disappear; it will remain open in the background! If you re-"open" Sublime, you'll see your work intact. In fact, if you haven't saved it to disk, you may incorrectly believe you're using your changes, when they are not on disk. To date, this is the only app I've seen disrespect the request for close. YMMV. Be careful.
Discovery:
I know this because I accidentally press Alt+Q all the time when my fingers slip off of the TAB key during Alt+Tab. I found your answer while looking for a way to shut this off. ;)