Bug 500076 - Kill Dialog should be summoned after a number of attempts of closing an app
Summary: Kill Dialog should be summoned after a number of attempts of closing an app
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 6.3.0
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks: 500921
  Show dependency treegraph
 
Reported: 2025-02-14 16:11 UTC by Fernando M. Muniz
Modified: 2025-03-01 20:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
"Close" button does nothing. (3.25 MB, video/x-matroska)
2025-02-14 16:11 UTC, Fernando M. Muniz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fernando M. Muniz 2025-02-14 16:11:00 UTC
Created attachment 178364 [details]
"Close" button does nothing.

I'm requesting that the Kill Dialog would spawn after a number of attempts of closing an app.

In the attachment it shows a window that refuses to open, so using Alt+F4 and Ctrl+Meta+Esc doesn't work (I've tried clicking the skull on the icon on the panel and it killed plasma).
Comment 1 Fernando M. Muniz 2025-02-15 02:13:24 UTC
Or to better respect the user's autonomy, an option called "Terminate" could appear after trying to normally close the app a couple of times.
If the user manages to press the "Close" button a couple of times, that means that the app is not responding.
Comment 2 cwo 2025-02-16 16:28:27 UTC
Plasma already does this for applications that hang. What window did this happen with?
Comment 3 Fernando M. Muniz 2025-02-16 20:15:08 UTC
(In reply to cwo from comment #2)
> Plasma already does this for applications that hang. What window did this
> happen with?

It was a Lutris (Flatpak) window.
Comment 4 Fernando M. Muniz 2025-02-16 20:30:50 UTC
(In reply to cwo from comment #2)
> Plasma already does this for applications that hang. What window did this
> happen with?

I don't believe that the application was unresponsive as in frozen, I think it was unresponsive as in "I don't understand what the system is asking or/and I'm busy.".

The solution presented in Comment 1 solves this issue because it uses the users themselves as timer by having them click "Close" too many times that it would be safe to assume the app is unresponsive in a unorthodox way.
Comment 5 cwo 2025-02-17 10:42:55 UTC
(In reply to Fernando M. Muniz from comment #4)
> I don't believe that the application was unresponsive as in frozen, I think
> it was unresponsive as in "I don't understand what the system is asking
> or/and I'm busy.".

"I'm busy" should count as unresponsive. 

> The solution presented in Comment 1 solves this issue because it uses the
> users themselves as timer by having them click "Close" too many times that
> it would be safe to assume the app is unresponsive in a unorthodox way.

I am a bit concerned here; if the app is still resposive it might be because it is in a state where killing it could lead to data corruption or loss. Simplest case is that it popped up a "you have unsaved changes" dialog that did not get raised for some reason, or it is in the process of saving a very large file that would get corrupted if interrupted. Offering to force close seems dangerous here (and is always available from the system monitor).

In this particular case it seems like there was another issue with the window in that it seemed like it couldn't be activated, which to me seems like the real bug. (Or that it somehow did not register as unresponsive).

But I'll let someone else handle this.
Comment 6 John Kizer 2025-02-28 06:37:37 UTC
Many, many everyday users furiously repeat clicks (I've personally seen 3-4 per second) on interface elements that don't instantly respond. This proposal would cause Plasma to suggest to such folks that they perform an action that would likely lead to data loss, including in cases where a program is just taking a few seconds "cleaning up".

In the situation shown in that video, Meta+Esc to pull up System Monitor, then selecting the problematic application and choosing Quit (or the equivalent on the Processes tab) would have solved the issue. I'm happy to be overridden by a developer here if appropriate, but I believe System Monitor would be the intended workflow in this situation.
Comment 7 Nate Graham 2025-02-28 15:31:54 UTC
In this case I think Fernando is requesting it only when repeatedly trying to close an app — e.g. by clicking the window close button or closing the app using Alt+F4, not just when repeatedly clicking any UI element. I agree that doing it for any UI element would be highly dangerous.

The problem here is that the hanging app was Lutris, which uses CSDs, which means the close button was drawn by the app rather than KWin, which means the close button was probably non-functional too, and there was no way for KWin to detect that. Perils of using CSD apps.

However KWin could probably detect repeated presses of Alt+F4.