Ask the user whether they want to quit, instead of close the window

Frequently, when I choose to close a window, I actually want to quit the application, because I’ve merely forgotten that I have a second window open.

Uses

  1. dolphin-24.12.0.1-1.fc41
  2. kate-24.12.0-1.fc41
  3. kdevelop-24.12.0-2.fc41

These are merely examples of applications which support tabs and windows, and thus would benefit the most, since you can lose multiple tabs when a single additional window is accidentally closed.

Existent Implementations

firefox --new-tab 'about:config' exposes this functionality (albeit in a less intelligent manner) via "browser.warnOnQuit": true.

I had to learn with Firefox a few tricks - I set mouse gestures for closing tabs, and the last tab closed the window - but with two windows it didn’t close the application…

So then I’d close the window, and have issues with sessions remembering the OTHER window and forgetting the one I’d closed… also pretty bad.

So we must learn CtrlQ will close the application… and we expect that this will close any remaining windows with that application.

However, this doesn’t seem to work with Dolphin - which is annoying… though we CAN get this from the context menu from the taskbar (I am not much of a mouser, I don’t like this to be the only option).

I disagree with your proposal though.

  1. CtrlW to close tabs - the last tab closing just that window.
  2. AltF4 should close the entire window, not the application.
  3. CtrlQ should be set to quit the entire application.

With these shortcuts set consistently, then I see no problem here - so this should be filed as a Dolphin bug…

CtrlQ fails to quit the application.

However, I do believe that this is not actually recognised as a ‘universal’ shortcut… despite saying ‘Quit’ and despite Windows users being famous for thinking that to ‘X’ a window is to Quit the Application…

Plasma seems to be further muddying these waters… leaving the ‘Close All’ option only as a Taskbar function… and you can’t set ‘Close All’ in Dolphin keyboard settings.

This applies to MANY KDE applications.

@ben2talk, not everyone uses a keyboard. I utilize Plasma on my tablet, and thus don’t have ready access to keyboard shortcuts.

In Windows, all window decorations are CSD (albeit overlaid over very old SSD), as my SE SU answer about this explains. Consequently, whether a window’s decorations perform a specific function isn’t standardised. KWin provides similar functionality, permitting the application to (at least, initially) override the window close functionality so that it can warn the user. As aforestated, Firefox implements this.

Why? Whether the subsequent section is substantiation for this statement, or separate, isn’t evident — apologies.

Hi - I’m a bit unclear, which way are you proposing:

  • That closing one window of an application with multiple windows open asks the user if they then want to close all remaining windows
  • That closing any window of an application that could possibly support multiple windows prompts for confirmation

I read your post title as the former, but I read your comment about losing multiple tabs as implying the latter.

If it is the latter - perhaps that sort of situation in those applications might also be served by a feature to recreate recently closed windows, similar to the Firefox one?

1 Like

@johnandmegh, solely this.

That would be wonderful, albeit the purview of another post. I’m wary of submitting too many FRs that I can’t assist in the development of, though.

Ah, I was considering Plasma as a Desktop environment - whereby my points stand firm.

However, the window (X) should be for closing a window, not the entire application (as is the case for Firefox).

Obviously removing keyboard access (and the same also applies to using a mouse with X11) is going to limit your possiblities.

For example, I have at least 3-4 different actions - mapped to mouse gestures as well as keyboard shortcuts:

  • Drawing a Q does Ctrl+Q (Quit…)
  • ‘X’ (drawn as an alpha - from top right) = Alt_F4 (Window Close)
  • ‘K’ in a circle = KillWindow (qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut “Kill Window”;0`) gesture.

There are always limitations, I guess, to limiting interaction to touch screens, or assuming everyone uses touchpads (where ‘mouse gestures’ don’t work) or keyboards (which deny mouse access).

I guess this is one reason I ended up back on X11, because the combination of Mouse Actions with Keyboard Shortcuts is so unbelievably powerful.

So finally, what’s the path forward? I don’t believe that options should be removed, I think options should be preserved.

So the Firefox way is my choice - to have the window action be to Close the Window which is separate from the action ‘Quit’… but allowing us to quit the application from the menu (Alt_F, then Q usually works).

Let’s not go all in on touchscreen interfaces for Plasma desktop users.

Tablet users need to buy a keyboard and/or a mouse innit?

@ben2talk, to suggest that tablet users purchase hardware solely to control window closure whilst continuing to provide useless functionality in their window decorations in nonsensical, and I’m certain you realise that. Consequently, I don’t understand why you’d state this.

Irrespective, your suggestion shall never occur, and this problem applies to desktop contexts too (as aforestated).

The alternative – what I propose – wouldn’t be mandatory, so why do you oppose it? You reiterate your opinion more verbosely, but it continues to lack rationale.

I think that keyboards would not be ‘soley to control window closure’… and what you’re complaining about brings up the stark differences between between ‘close window’ and ‘quit application’.

These would be easily managed with a keyboard or mouse gesture - but for the GUI, you have File menu>Quit vs window control X already.

So the question could apply to ‘Quit application should or should not close all windows’.

It is certainly NOT acceptable to offer dialogs (perhaps necessary for mobile users) to be put in place which would annoy users who do have keyboards/mouse control… which is still the most productive, and most standard method of interacting with our computers.

Since we’re in Brainstorm space here…what if, when you closed a window for an application that still had another window open that wasn’t already visible on-screen (either minimized, covered by other windows, on another virtual desktop, etc.), or a background task running, you could opt-in to a temporary notification - like a “MyCoolApp is still running in other windows”, with a Quit button presented in the notification so the option to totally exit the application could be chosen if desired?

The catch to all of this is, I suspect that “Quit” is going to mean different things or be implemented in different ways across different applications, so that would likely be a sticking point in implementing anything at the overall desktop environment level - but just thought I’d throw the idea out there.

For my personal opinion: I could see it being annoying if I were asked every time I closed a window if I wanted to close the rest of the application, if I could already see other windows open. If no other obvious interface to that application was on the screen, though, then I could see something passively available being useful.

Let’s debate the merits of the topic at hand - I don’t think debating the value of alternative input devices is necessary to discuss the idea, and support for diverse input methods is explicitly a KDE Goal.

2 Likes

In that case, the option to ‘Close All’ is available in the Taskbar, and with experience of iOS and Android phones and tablets, the task manager is how we expect to interact - swiping to reveal applications running, or having a ‘dock’ across the bottom.

These are not ‘windowed desktops’ as such - extra functions for the mobile desktop could be made available via menu, or keyboard shortcut, as an optional extra.

The option to ‘Close This Window’ is available in the Titlebar, just as the option to close a tab is presented on the ‘titlebar’ for a tab - so mousers and touchscreens are already covered.

Kate and Dolphin are already divergent… only individual windows can be closed, and no alternative exists to ‘Close All Windows’… but they differ widely - Dolphin works as a ‘browser’ should…

  • Open new tab,
  • Close tab,
  • restore tab
    These shortcuts work for Dolphin just as they do for Firefox… they work with keyboard/mouse actions too.

Konsole, which has unique shortcuts for many inherent reasons (for example, the copy/paste shortcuts had to be ‘shifted’)… so ‘advanced’ options are shifted into menus.

Kate has ‘Close All’ (for tabs) but no option to ‘Quit all’ to include all windows.

If you open a tab in konsole, first there’s no ‘Quit’ option, but ‘Alt+F4’ tries to close the window with a confirmation (close all, or close just this tab) - but it won’t apply to all windows.

However, Konsole does not offer ‘session restore’ - and so again, very confused idea to use exactly the same ideas for all applications.

So really, the question might be more associated with the behaviour of Firefox.

QUIT can be queried as to whether it means ALL WINDOWS.
Alt+F4 means ‘Close THIS window and tabs’
Ctrl_W means ‘Close this tab’ and a further option to close the window with the last tab.

1 Like

The ability to use Ctrl+Q to terminate the current application that is in focus, whether it is GTk or QT based, would be a very useful addition to Plasma.

Applications that have already added support for Ctrl+Q will be able to gracefully exit, and plasma will use PID to determine whether the process is still running. If it is, plasma will send a kill command to that program. All of this should occur in less than a second to ensure speed and avoid giving the impression that the program is revolting or that the DE is lagging.

@cleanerspam and @ben2talk, I’m quite confused by what’s being discussed now. Consequently, to clarify:

  1. I’m solely requesting that, for applications which are multi-instance, systemsettings and/or the applications’ relevant configuration window (or page) provide the option to warn the user before closing a single window, irrespective of input device (keyboard, whether by shortcut or not, touch device, or mouse).

  2. I ask this because, irrespective of what method is utilized to close that window, I frequently do not realize that I have multiple open.


It’s more problematic when plasmashell is not running.

1 Like

I don’t think the request makes sense, sorry. It seems like it would get annoying fast.

What about that Ctrl+Q to kill any foregorund app in focus as a global shortcut enforced by Plasma ?

@ngraham, definitely, if you tend to use more than one Dolphin window at a time.

For me, I’ve only ever got more than one open because I’ve asked VS Code or Firefox to show me the path of a file from their GUIs. Otherwise, I’m working in the tabs of a single window.

It doesn’t work perfectly but let’s pretend it does - what about “Keep a single Dolphin Window, opening new folders in tabs”?

I’m thinking this over and let’s ignore the UI for a moment…Let’s pretend the user has hit whatever button or key they needed to, to trigger this feature, and they say “Yeh, I want to quit the entire application, not just this one window”… Is there even a global implementation of “quit the entire app”? Like, how might we send a message to any given application, to get it to close all of its windows, tray icons, background processes, etc?

Forgive me if I’m wrong, but I’m not so sure that’s even a thing. Edit: Perhaps you meant for this to only work for KDE apps?

2 Likes

Maybe peeling it back a little…what negative situation are you looking to avoid by having a forgotten-about Dolphin window closed?

1 Like

Can’t speak for our friend but I have problems with this. Dolphin will save your session, so you might have a dolphin window open with lots of tabs you are presently using… if you close that window you did want to save, and now you have some other window open that was open by accident and you did not want to save, too bad, you just lost your saved session.

This is by a long margin the #1 use case for BTRFS snapshots on my PC. Happens to me a few times a week.

1 Like

@pallaswept, yeah. I’d like it to be as consistent as possible, but the amount of work would be incomparable.

@johnandmegh, losing tabs when I close a window, because I’ve incorrectly expected that when I re-open it, they’ll remain. They shan’t, because another window was open, and I forgot to check. This occurs in browsers when you’ve multiple windows, hence the previous comparison.

Thanks for asking.

I’m getting where you’re going now - and I’d argue that the best solution there would be to offer either a temporary “undo that action” popup, or an ongoing “restore closed windows” menu, for the applications where it’s desirable.

The intrusive confirmation dialog approach, in my admittedly non-expert estimation, would

  • Still be destructive, with non-trivial recovery, if you mis-click
  • Would likely condition users to click the same way each time - making it less likely that they’ll click correctly when it’s actually really needed

That’s partly influenced by the “Maximize safety” section of the KDE Human Interface Guidelines, which feels pretty relevant to the topic now, and partly by just my own experience - I have clicked past “clicking the wrong button here does something bad!” dialogs more times that I could count, so I’d be interested in a way to solve the problem you describe that doesn’t introduce another such dialog.

3 Likes