Good report on the situation, thanks.
Mostly I’m saying that when possible we should use “modern” techniques to accomplish what the users want.
If not fullscreen, we should not grab keyboard, this has nothing to do with X extensions of any kind.
If fullscreen and the modern features (XRandR, NET_WM_FULLSCREEN) are supported then we should not be grabbing keyboard.
When no video mode change is requested, this comes down to only NET_WM_FULLSCREEN as a consideration.
To put that another way; if using a managed window (which we should where possible) we should not be grabbing keyboard, if using an override redirect window then by design we MUST grab keyboard and
mouse for the entire duration of that window, but we should not be using an override redirect window unless absolutely necessary.
In general my preferred failure modes in a game are:
NET_WM_FULLSCREEN not supported - play game in a maximized window (with border).
XRandR not supported - disable video mode switching (can still do fullscreen).
Both of these solutions are very predictable in the user experience.
I’m not saying we need to remove XVidMode support or anything of that nature, only that these failure modes do not seem that bad to me, so I’m not sure why we NEED XVidMode and override redirect
window handling.On 01/31/2012 11:53 AM, Karl wrote:
Now to Keyboard Grabs: Yes they are really bad and i think sdl shouldn’t
use them at all except for old window managers which don’t support the
fullscreen atom. That’s all i want to say about it now, but it
definitely needs to be discussed.
–
LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier