Alt+Tab and other WM shortcuts not working while pointer is grabbed

Octavio Alvarez alvarezp at alvarezp.ods.org
Tue May 18 18:12:45 PDT 2010


On Sun, 09 May 2010 12:58:38 -0700, Lasse Kärkkäinen <ljkarkk2 at cc.hut.fi>  
wrote:

> I'm sure everyone here is already familiar with this problem, as it has  
> been around for a decade at least. I am talking about not being to  
> switch to another window from a full screen game (even though the issue  
> itself has nothing to do with full screen windows).

I also thank you for bringing it up.

> The usual response to this problem is that it is a bug in the game and  
> that it should be fixed there.

And that response is broken for security reasons: a malicious application
might grab the whole keyboard and mouse and there would be no way of
switching to a terminal emulator (not a VT) to kill the app.

If you are using GNOME, another example would be to open the "Applications"
menu. Any popup menu presented by X requires keyboard / mouse grabbing.

Take a look at this discussion:
https://bugzilla.gnome.org/show_bug.cgi?id=344059

> On the other hand, always keeping Alt+Tab to the WM might disturb remote  
> desktop usage and other things.

So what? Not even a Remote Desktop should ever prevent the user from
switching through his local applications.

I would bet for a way to map the virtual Alt+Tab to Alt+CapsLock.

> One option to consider is adopting the Super key as a general WM
> accelerator key as an alternative to Alt. Since it is generally not
> used by any application software, keeping it to the WM would work
> rather well. One could still use Alt instead to control a virtual
> machine.

Oh, please don't. I use the Super key by means of a third party app,
and I use it a lot, particularly for global key bindings and
scripting. That would completely break my work flow.

An idea I've been thinking for quite a time is that Ctrl should be
for the application, Alt (Meta) for the WM and Super for the user.

I haven't though about combinations.

> Another thing to consider is that most WM shortcuts should indeed be  
> disabled for games. For example, Alt+drag is commonly used in RTS games  
> for giving orders but currently that doesn't work without grabbing  
> because the WM thinks that one is trying to move the window.

If you are grabbing the whole keyboard for the game, why not just use
a different modifier key, instead of Alt? Say use "Z" as a normally-open
button to "giving orders" mode. Some games use scan codes so they can
detect "physically down" and "up" as opposed to "logically pressed" and
"release + autorepeat".

That's where I think some games are broken too.

> Kiosk applications would also be affected, as they may currently think  
> that they can securely grab all input (except Ctrl+Alt+BS, SysRq and VT  
> switching which need to be disabled elsewhere), so care must be taken  
> with any change to the grabbing behavior.

A kiosk application should require a kiosk-compatible WM or be the WM
itself. Expecting to have an application to take control of a desktop in
order to make it work as a kiosk seems flawed to me.

> So, can this problem finally be fixed, so that maybe 2011 would be the  
> year of the Linux Desktop :-)

:-P



More information about the xdg mailing list