|[PATCH] Grabbing the keyboard in X11|
At the moment, SDL grabs both the keyboard and mouse on X11 when
SDL_SetWindowGrab() is called, but only grabs the mouse on win32 and
other platforms. This means that Alt+Tab (and similar WM keys) don't
work, which is a bit of a pain. While the old-style X11 fullscreen code
(for WMs which aren't ICCCM-2.0 compliant) needs the keyboard grabbed,
otherwise simply grabbing the mouse suffices.
There are a couple of different ways of resolving this: allowing the
user to grab the mouse and keyboard separately, perhaps with something
like SDL_SetWindowGrab(w, SDL_GRAB_KEYBOARD | SDL_GRAB_MOUSE), or by
simply making the X11 backend only grab the keyboard when in old-style
fullscreen mode. I have implemented the latter --- the patch is attached
--- and it seems to work quite well.
What do you think the right way forward is?
SDL mailing list