Page 1 of 1

Hotkey to Close the Current Window

Posted: Mon Jun 25, 2018 7:28 pm
by raywood
Let's say I have sessions of Terminal, xed, Thunar, and Firefox open currently. This would be comparable to having a command window, Notepad, Windows Explorer, and Firefox open in Windows. In Windows, Ctrl-W has relatively desirable behavior, for my purposes: it closes the Windows Explorer session and the current Firefox tab. It has no effect on the command window or Notepad, unfortunately.

I switch back and forth between the two operating systems. How close can I come to setting Ctrl-W or Super-W to close any of the foregoing? So far, I'm not finding a single universal (or even semi-universal) command that I could assign to a hotkey to close the currently selected window, dialog, or tab in LMX.

This is not a high priority for me. It is a bell or whistle that I would ideally add. In part, I'm just curious. But if I could get that functionality, it would help. TIA.

Re: Hotkey to Close the Current Window

Posted: Mon Jun 25, 2018 7:49 pm
by gm10
I'm not on Xfce but Ctrl+W already seems to be the default for closing tabs in those apps (Ctrl+Shift+W in the terminals)? Either way, a hotkey for closing a tab has to be provided by each application individually, you cannot configure that globally. So check the respective application setings/preferences.

Re: Hotkey to Close the Current Window

Posted: Mon Jun 25, 2018 8:13 pm
by catweazel
gm10 wrote:
Mon Jun 25, 2018 7:49 pm
I'm not on Xfce but Ctrl+W already seems to be the default for closing tabs in those apps (Ctrl+Shift+W in the terminals)? Either way, a hotkey for closing a tab has to be provided by each application individually, you cannot configure that globally. So check the respective application setings/preferences.
Nonsense.

Re: Hotkey to Close the Current Window

Posted: Mon Jun 25, 2018 8:19 pm
by catweazel
raywood wrote:
Mon Jun 25, 2018 7:28 pm
In Windows, Ctrl-W has relatively desirable behavior
Alt-F4 is the standard method for closing windows. In Xfce, go to Window Manager, and on the keyboard tab, select 'Close window', double-click to clear, then set Ctrl-w as the action for F4. However on my xfce, ctrl-w closes windows without changing the setting.

Re: Hotkey to Close the Current Window

Posted: Mon Jun 25, 2018 8:19 pm
by gm10
catweazel wrote:
Mon Jun 25, 2018 8:13 pm
gm10 wrote:
Mon Jun 25, 2018 7:49 pm
I'm not on Xfce but Ctrl+W already seems to be the default for closing tabs in those apps (Ctrl+Shift+W in the terminals)? Either way, a hotkey for closing a tab has to be provided by each application individually, you cannot configure that globally. So check the respective application setings/preferences.
Nonsense.
Thank you for your helpful contribution. Then explain to me (or rather the OP) how a global hotkey from the window manager can interact with tabs in an application. Your explanation about closing the whole application window down, while correct, will hardly help him with that.

Re: Hotkey to Close the Current Window

Posted: Mon Jun 25, 2018 10:21 pm
by aes2011
raywood wrote:
Mon Jun 25, 2018 7:28 pm
to close the currently selected window, dialog, or tab in LMX.
+1 gm10.

I very much doubt you can have one command that deals with closing tabs as well as with closing normal windows and tabs in applications.

Re: Hotkey to Close the Current Window

Posted: Tue Jun 26, 2018 1:28 am
by AZgl1500
I'm using 18.3 Cinnamon,

and ALT-F4 will close everything period, no problems including Terminal.

Re: Hotkey to Close the Current Window

Posted: Tue Jun 26, 2018 12:43 pm
by k-314
AZgl1500 wrote:
Tue Jun 26, 2018 1:28 am
I'm using 18.3 Cinnamon,

and ALT-F4 will close everything period, no problems including Terminal.
...but the question was about Xfce.

Re: Hotkey to Close the Current Window

Posted: Tue Jun 26, 2018 2:38 pm
by mint4all
k-314 wrote:
Tue Jun 26, 2018 12:43 pm
AZgl1500 wrote:
Tue Jun 26, 2018 1:28 am
I'm using 18.3 Cinnamon,

and ALT-F4 will close everything period, no problems including Terminal.
...but the question was about Xfce.
Greetings! I have been using Mint's xfce-editions for over 4+ years (and have tested a number of other distro's exploring how they have tweaked xfce, i.e. xubuntu's spin), and never had a problem using the ALT-F4 key to close open windows (except, of course, when an app has crashed or hangs) just as catweazel indicated above. Just to be sure, i opened ~10 different apps, incl. Terminal, on top of each other, then used ALT-F4 to close each of those "open" windows with the last one bringing up the logout popup. Afaict, no problem at all. Note: any minimized apps remain in xfce's window list, btw.

Just in case one needs to tweak something, there's more info available about typical linux shortcuts @ https://help.ubuntu.com/community/KeyboardShortcuts and @ https://en.wikipedia.org/wiki/Magic_SysRq_key ... Hope this helps.

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 3:43 pm
by MtnDewManiac
catweazel wrote:
Mon Jun 25, 2018 8:19 pm
Alt-F4 is the standard method for closing windows.
In linux, too? I had been assuming that it was the standard method in Microsoft OS (for many years, at least), but wasn't sure about linux. I had been privately assuming (there I go, assuming again :lol: ) that this was another example of "The linux experience is like dealing with 1,000 rabid cats" in that there wasn't really a standard. CTRL Q seems to exit most applications I use, even ones that aren't "linux onlu" (such as Firefox). One notable exception being mint-Update, but as it still occasionally fails to display a changelog for the files it wishes to upgrade, I figure that anything else that it fails at is, realistically, pretty minor as long as it doesn't actually cause a fire :roll: . But with most apps, CTRL Q performs an exit and CTRL W closes a tab (if present) or window (ditto, if the application supports multiple windows), without actually exiting.

But if ALT F4 is the correct way to immediately exit an application and/or popup window, then I will attempt to train myself to use this combination instead of CTRL Q.

Regards,
MDM

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 3:56 pm
by AZgl1500
In Mint Cinnamon and some of the other distros,

ALT-F4 closes every app I have tried it on, including Terminal.

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 4:56 pm
by gm10
MtnDewManiac wrote:
Mon Jul 02, 2018 3:43 pm
But if ALT F4 is the correct way to immediately exit an application and/or popup window, then I will attempt to train myself to use this combination instead of CTRL Q.
The more mainstream distros have just picked it up to make the transition from Windows easier. Personally I use Ctrl+Q mostly, easier to reach. On the other hand, I configured Win+E to open the file browser, blatantly copied from the Windows world, but it's a good combination.

To go with the old Perl motto, there's more than one way to do it. Use whatever suits your work flow best.

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 6:14 pm
by catweazel
gm10 wrote:
Mon Jul 02, 2018 4:56 pm
The more mainstream distros have just picked it up to make the transition from Windows easier.
I'm not sure that's correct. It's been in UX design guidelines since the year dot. Consistency in UX is a golden rule.

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 6:22 pm
by gm10
catweazel wrote:
Mon Jul 02, 2018 6:14 pm
gm10 wrote:
Mon Jul 02, 2018 4:56 pm
The more mainstream distros have just picked it up to make the transition from Windows easier.
I'm not sure that's correct. It's been in UX design guidelines since the year dot. Consistency in UX is a golden rule.
Probably a hen/egg problem, but I'm good with either, makes no difference at the end of the day.

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 6:56 pm
by mint4all
gm10 wrote:
Mon Jul 02, 2018 6:22 pm
catweazel wrote:
Mon Jul 02, 2018 6:14 pm
gm10 wrote:
Mon Jul 02, 2018 4:56 pm
The more mainstream distros have just picked it up to make the transition from Windows easier.
I'm not sure that's correct. It's been in UX design guidelines since the year dot. Consistency in UX is a golden rule.
Probably a hen/egg problem, but I'm good with either, makes no difference at the end of the day.
Fwiw ... You're looking at 25+ years of keyboarding tradition. The ALT+F4 combo (afaicr) was introduced by IBM in ther "CUA" (common user access) specification which was adopted by MS in Windows 3.1 (ca. 1992) & IBM in OS/2. You can find that old keyboard shortcut map @ http://allhotkeys.com/os_2_hotleys.html ... Funny how history repeats itself, eh? :wink:

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 7:07 pm
by gm10
Wow OS/2, now that's a blast from the past. Also interesting (mostly the fact that somebody would go to the trouble of creating this): https://en.wikipedia.org/wiki/Table_of_ ... _shortcuts

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 9:40 pm
by lsemmens
Time was when the only keyboard shortcut you needed to know was the old "three finger salute" or <Ctrl> <Alt> <Del> to terminate a process when Windoze wouldn't behave. Haven't needed that since the move to Linux. :D

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 9:49 pm
by catweazel
lsemmens wrote:
Mon Jul 02, 2018 9:40 pm
Time was when the only keyboard shortcut you needed to know was the old "three finger salute" or <Ctrl> <Alt> <Del> to terminate a process when Windoze wouldn't behave. Haven't needed that since the move to Linux. :D
KDE uses it to offer logout/shutdown options. Presumably other DEs do the same.

Re: Hotkey to Close the Current Window

Posted: Mon Jul 02, 2018 11:16 pm
by MtnDewManiac
catweazel wrote:
Mon Jul 02, 2018 9:49 pm
lsemmens wrote:
Mon Jul 02, 2018 9:40 pm
Time was when the only keyboard shortcut you needed to know was the old "three finger salute" or <Ctrl> <Alt> <Del> to terminate a process when Windoze wouldn't behave. Haven't needed that since the move to Linux. :D
KDE uses it to offer logout/shutdown options. Presumably other DEs do the same.
I just tried it in Xfce (I believe this is my Mint 17.3 partition). The screen slowly faded to black. I waited a few more seconds, then pressed any key (lol) - and some archaic-looking window popped up, which required me to enter my password. After doing so, I got my system back. I assume, in Xfce, this keyboard combination is a shortcut for locking the computer without logging out or something?

I had previously thought that I could use that combination to run the task manager application included with Xfce. Apparently, I was mistaken.



Regards,
MDM