Bug 323528 - Wayland: Fullgrab-Alternative for Games (avoid global hotkeys to be annoying in-game)
Summary: Wayland: Fullgrab-Alternative for Games (avoid global hotkeys to be annoying ...
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-15 05:53 UTC by Dimitri Nüscheler
Modified: 2013-08-17 15:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Nüscheler 2013-08-15 05:53:30 UTC
With Wayland kwin is going to be able to implement global hotkeys reliably, while with X11 it is unable to do reliably, because Games use to do a full grab (XGrabKeyboard I guess).

Having hotkeys is welcome, because there is a need to switch to other applications , one might also prefer to adjust the speakers using the system-control and not the ingame-control and last but not least I really don't like to switch to a text-terminal to kill a frozen fullscreen game.

However, there is something I like about the fullgrab. It avoids triggering actions that are useful on the desktop, but not ingame.

Is kwin going to have some sort of mechanism to execute only important hotkeys with wayland?
If yes, how is the fullscreen game going to tell the window manager that it doesn't want the "unimportant" actions to be triggered? (Is there a weakened XGrabKeyboard-equivalent in Wayland?)

important: Switch to other applications (Alt+Tab), xkill (Ctrl+Alt+Esc) (Alt+Tab is almost critical though, because both keys are used in First-Person Shooters at times)

unimportant: launching applications, minimize the window - it actually depends on user preferences

Reproducible: Didn't try

Steps to Reproduce:
1. Define a hotkey for opening a terminal (and flag as "unimportant")
2. Press the new hotkey
3. Launch a fullscreen game
4. Press the new hotkey
5. Try to switch to another application (using Alt+Tab)
Actual Results:  
I don't know

Expected Results:  
2. The terminal opens
4. The terminal does not open
5. The application is switched (e.g. to the previously opened terminal)
Comment 1 Martin Flöser 2013-08-15 06:00:59 UTC
With Wayland KWin is responsible for handling global shortcuts and 
applications are not able to grab the keyboard (security feature). Furthermore 
KWin supports a feature of blocking global shortcuts per window rule. This 
will also be available in Wayland. So a user can simply decide it for himself. 
This is the only possible solution and much better than asking the application 
whether it is important (of course it is, every app is important).

I don't see anything to implement here or how exactly implementing this 
feature request -> RESOLVED WORKSFORME
Comment 2 Dimitri Nüscheler 2013-08-16 11:05:28 UTC
I didn't know KWin supports a feature of blocking global shortcuts per window, thanks.

So building on that is probably the best idea, but in my opinion the current implementation of this feature is not fully satisfying my requirements, because I don't want to disable Ctrl+Alt+Esc and Alt+Tab, but all others Global Hotkeys for a certain window.

Assume I have a game that freezes sometimes and also interferes with some global hotkeys.
Then I'd like to ignore all global hotkeys but Alt+Tab and Ctrl+Alt+Esc.
Comment 3 Thomas Lübking 2013-08-16 19:44:48 UTC
It's a feature of kglobalacceld, kwin just de/activates it depending on which client atm. has the input.

With wayland things however change and kwin will actually have control depending on this rule.

Regarding "good" and "bad" global shortcuts, I doubt there's such.
Anything that intercepts action is really bad while a Legion of Imps is running upon you (because whatever it is: you're dead)

The "solution" to this is usually the kernel shortcuts (ctrl+alt+F[n] for VTn) - which have the advance that its very established and thus not easily used anywhere.

Other shortcuts are configurable (ctrl+alt+esc does nothing for me) and you cannot really prevent users from assigning ctrl+^ / ctrl+~ to "kill this window" ...
Comment 4 Dimitri Nüscheler 2013-08-17 15:08:21 UTC
Ctrl+Alt+F[n] is exactly what I do today (Today I have no choice, XGrabKeyboard forces me to do so anyway), but I was looking for a quicker way (such as Alt+Tab), because with Ctrl+Alt+F[n] I have to manage a second session (or log in to one) and type a set of commands to get the window game window killed or moved to background and that's cumbersome.

It's perfectly fine if I can define myself what's "bad" and "good" shortcuts.
I'd be completely happy if I could just define a whitelist of exceptions at the "ignore global hotkeys" function.

I don't need the system to know what's interfering (bad) and what not (good). I can know it for it.