Bug 454245

Summary: Pop-ups stealing clicks
Product: [Plasma] kwin Reporter: meso5 <meso5>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: wishlist CC: kde, nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description meso5 2022-05-23 01:04:02 UTC
It is incredibly annoying when you click on something and a pop-up appears out of nowhere in precisely the wrong place stealing the mouse click. Particularly frustrating when you know you just OKed something but you don't know what because the pop-up disappeared immediately. It doesn't happen often but when it does it can be very dangerous too. It is surprising it can still happen in every environment I am aware of, but I think KDE could be the first DE to do the sensible thing: A clickable element shouldn't be clickable until it is reasonably possible for a human being to have clicked on it on purpose. Clicks that are faster than this are either stolen clicks or robo-clicks. One idea is to grey-out the buttons for a fraction of a second before they become really clickable. If this takes a fraction of a second, in the vast majority of cases that a pop-up appears the user won't even know this delay was injected. In the spirit of KDE this could be made optional.
Comment 1 Nate Graham 2022-05-24 14:42:51 UTC
This turns out to be a surprisingly hard problem to fix, but KWin has a "focus stealing prevention" setting in System Settings > window Management that you can tweak to your level of satisfaction here.

On Wayland, you should see a lot less focus stealing in general, due to a better base architecture that doesn't require so many focus stealing prevention hacks in the window manager.
Comment 2 meso5 2022-05-24 15:41:37 UTC
I am aware of focus stealing prevention. My understanding is that it would turn click-stealing and many more pop-ups into pop-behinds. Then, you would have to bring the dialogue to the front to click its button. This adds friction and penalises the user. A tiny delay in making the buttons active would work seamlessly. In the vast majority of cases, users won't even realise click-stealing is designed out, until the day a click-stealing situation occurs to them. At that point they will be hugely impressed if they realise the protection is by design. I appreciate though a delay may be too difficult to implement.