Bug 418631

Summary: When playing a game (full screen) don't let a dialog steal the focus
Product: [Plasma] kwin Reporter: postix <postix>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: wishlist CC: kde, plasma-bugs-null, postix
Priority: NOR    
Version First Reported In: 5.17.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description postix 2020-03-08 15:50:22 UTC
When playing a game (in my case Pathfinder) it's very annoying if another app steals the focus with a dialog window popping up.

In my special case the Wifi got disconnected and due to a another bug the network manager forgot (temporarily) about the password and asked me to enter it again -- in the middle of a game. :(

I think this should be prevented somehow.


SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.1
Kernel Version: 5.5.7-1-MANJARO
Comment 1 postix 2020-03-09 11:35:26 UTC
You can easily test it yourself by (accidentally) pressing "print" while playing, which results in Spectacle popping up. 
If the game is about reaction speed, you'll lose with a nice screenshot. :)
Comment 2 David Edmundson 2020-03-09 20:14:38 UTC
A keyboard grab would prevent this.

Most games do this.


Changing this for other windows would break many many other things.
Comment 3 postix 2020-03-10 12:04:09 UTC
(In reply to David Edmundson from comment #2)
> A keyboard grab would prevent this.
> 
> Most games do this.
> 
> 
> Changing this for other windows would break many many other things.

You did not read carefully enough. This bug report is not about keyboard grabbing, the example above should only serve as a easy demonstration for what happens if another window comes forward, stealing the focus...

Reopen it again.
Comment 4 Vlad Zahorodnii 2020-03-10 12:17:54 UTC
Please use a more "extreme" focus stealing prevention policy.

Unfortunately, the question whether dialogs should take focus by default depends on personal preferences of the user.
Comment 5 postix 2020-03-10 12:50:21 UTC
(In reply to Vlad Zahorodnii from comment #4)
> Please use a more "extreme" focus stealing prevention policy.
> 

I hadn't find this option, thanks! Maybe in Lutris this can be scripted to become activated once game has started? ;)
Comment 6 Vlad Zahorodnii 2020-03-10 12:52:42 UTC
(In reply to Postix from comment #5)
> I hadn't find this option, thanks! Maybe in Lutris this can be scripted to
> become activated once game has started? ;)

Unfortunately, I can't answer your question because I don't know what Lutris is.
Comment 7 postix 2020-03-10 12:56:48 UTC
(In reply to Vlad Zahorodnii from comment #6)
> (In reply to Postix from comment #5)
> > I hadn't find this option, thanks! Maybe in Lutris this can be scripted to
> > become activated once game has started? ;)
> 
> Unfortunately, I can't answer your question because I don't know what Lutris
> is.

I actually meant gamemode [1,2] and not lutris [3], which however work together.
It's fine, I will figure it out myself! Have a nice week! :) 

[1] https://github.com/FeralInteractive/gamemode
[2] https://wiki.archlinux.org/index.php/Gaming#Utilities
[3] https://github.com/lutris/lutris