[SDL] About focusing out of a fullscreen game (alt-tab or minimize)

Sam Lantinga slouken at libsdl.org
Tue Jan 31 18:00:33 PST 2012


Starting a discussion on the wm-spec mailing list is a great idea.  I was
thinking about doing that myself with respect to SDL 2.0 window management.

FYI, SDL 1.2 window management is not likely to change at this point.  For
better or worse, it has pretty much been consistent for the last 10 years
and I'm loathe to introduce changes to it at this point.

SDL 2.0 window management is completely different, and my goal for it is to
embrace and create the next generation fullscreen window management for
modern desktops.  To that end, I would love it if I and other people on
this list can put our heads together and worked out the best way to do
this, in collaboration with the window manager folks at freedesktop.org.

Cheers!

On Tue, Jan 31, 2012 at 2:53 PM, Karl <karl.glatzer at gmx.de> wrote:

>
>
> Am 31.01.2012 19:49, schrieb Forest Hale:
> > On 01/26/2012 04:13 AM, Sylvain Brunerie wrote:
> >> 2012/1/20 Forest Hale <havoc at ghdigital.com <mailto:havoc at ghdigital.com
> >>
> >>
> >>     My own experience suggests the desired behavior in 99% of cases on
> Linux is the following:
> >>     1. do not resize the desktop in any way (on Linux this tends to
> kill secondary monitors, and shuffle icons and windows around to fit the
> small space, both are very annoying).
> >>     2. open a maximized window and request the window manager to make
> it borderless (there's an Atom to negotiate for this).
> >>     3. grab mouse only, do not grab keyboard.
> >>
> >>
> >> A maximized borderless window will still have panels (in any)
> under/over it, won't it?
> >>
> >> I agree with points 1 and 3, as I hate having my resolution changed and
> my desktop icons messed up when a game doesn't quit correctly, and as I
> don't see what could be prohibitive with not grabbing
> >> the keyboard (this would allow Alt-F4 to close the window, Alt-F1 to
> open the Gnome Applications menu, but why not?). Not being able to change
> volume when in a fullscreen game may be, when I think of
> >> it, the first issue preventing me to play games under Linux.
> >
> > #2 is only a clarification, it describes the current behavior.
> >
> > X11 allows a window to be created that is managed by the window manager
> (this is the normal kind) and that can then negotiate for an Atom asking
> for fullscreen (borderless, covers panel, etc).
> >
> > X11 also allows a window to be created that is NOT managed by the window
> manager, this kind is borderless by nature (without the window manager to
> add decorative window rects around it for
> > interactivity), and CAN NOT receive keyboard or mouse events unless it
> grabs these input sources intentionally, which overrides the window manager
> shortcuts.
>
> Yes this is how things work with X11, but this:
>
> > As far as I understand it, SDL currently uses the managed type, and this
> is what I am saying we should stick to.
>
> is only true for SDL 2.0. SDL 1.2 still uses windows which are not
> (cannot be) managed by the window manager aka setting xoverride-redirect.
>
> I tried to backport the SDL 2.0 window handling to SDL 1.2 and even send
> a patch to Sam with an implementation that I thought was working.
>
> Luckily he refused it and I now found out that my backport broke the old
> behaviour which should be kept for window managers which don't support
> the fullscreen atom and in addition the current implementation in SDL
> 2.0 also isn't sufficient because it will only work correctly with
> XRandr mode switching.
>
> The better XVidMode mode switching sadly can't be used reliably with
> windows which are managed by the window manager.
>
> I already have an Idea how to solve this. I think the best way would be
> to add a new fullscreen method to the wm-specs on freedesktop.org which
> gives more control over the window to the application and is closer to
> the xoverride-redirect method in the way that it should be possible to
> place the window anywhere (not restricted by panels) and on top of the
> window stack when it is focused.
>
> I have worked this out a lot more and will start a discussion about it
> on the wm-spec mailing list of freedesktop.org soon.
>
> 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.
>
> PS: I also think that the keyboard shortcut handling should be improved
> possible by making another spec for it on freedesktop.org ;)
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20120131/8523886f/attachment.htm>


More information about the SDL mailing list