1

The documentation page for KDE says

Ctrl+Q Quit

Alt+F4 Close

Both seems to work the same way. What is the difference between them?

4

Ctrl+Q

  • is a keyboard combination that closes the entire application. Thus, if the application has multiple windows open, all windows will be closed
  • is a keyboard combination that is directly intercepted by your application. Thus, there might be applications that do not follow that convention, and where the keyboard shortcut will not be in effect.

Alt+F4

  • is a keyboard combination that closes the active window. Thus, if an application has multiple windows open, only the focussed window will be closed
  • is a keyboard combination that is intercepted by your desktop environment, more specific, the window manager. Therefore, it will work for any application.

Ctrl+W

  • Behaves in many instances like Alt+F4. However, it is a keyboard shortcut that is intercepted by your application. In applications that create multiple windows, it will close the current window ("document"). In browsers, the keyboard closes either the current tab, or the current window if only one tab is open.
  • Just a pointer, <Alt>+<F4> technically will not always "close" a single window, it usually does the same thing as clicking the close (X) button in window. If the application is set to run minimised in system tray on clicking the close button, <Alt>+<F4> would do the same. – pomsky Oct 6 '18 at 16:19
3

I have tested various applications on Kubuntu 18.04 (to relate to the question) starting multiple instances from the launcher or from a terminal if needed:

  • dolphin: Alt+F4 and Ctrl+Q close only the active window. Other open windows are unaffected.

  • featherpad from a terminal with --win: Alt+F4 and Ctrl+Q close only the active window. Other open windows are unaffected.

  • geany from a terminal with -i or geany --new-instance: Alt+F4 and Ctrl+Q close only the active window. Other open windows are unaffected.

  • google-chrome: Alt+F4 closes only the active window and other windows are unaffected. Ctrl+Q does nothing. Ctrl+Shift+Q closes all windows.

  • kate from a terminal with -n for "new instance": Alt+F4 and Ctrl+Q close only the active window. Other open windows are unaffected.

  • leafpad: Alt+F4 and Ctrl+Q close only the active window. Other open windows are unaffected.

  • mousepad: Alt+F4 and Ctrl+Q close only the active window. (Ctrl+Q explicitly has "Close Window" as its description.) Other open windows are unaffected.

  • LibreOffice Calc/Writer: Alt+F4 closes only the active window. Other open windows are unaffected. Ctrl+Q explicitly has "Exit LibreOffice" as its description and all windows (both Calc and Writer) are closed.)

  • mpv: Alt+F4 closes only the active window. Other open windows are unaffected. Ctrl+Q does nothing.

My practice has been to use Alt+F4 or the Close button. I don't use Ctrl+Q.


By the way, Common Keyboard Shortcuts which is the page referenced in the question as "The documentation page for KDE" has this caveat (which I've emphasized in the quote below):

This list contains the most common shortcuts supported by the workspace itself and many applications available within. Every application also provides its own shortcuts, so be sure to check their manuals for a comprehensive listing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.