Fullscreen support on X11 |
Sam Lantinga
|
Ryan and I have been working on fullscreen support on X11 for SDL 2.0, and I'd like to share the current status.
There are now two distinct fullscreen code paths, one for modern window managers and one very similar to the legacy fullscreen support in SDL 1.2. The modern fullscreen support uses the _NET_WM_STATE_FULLSCREEN hint defined in the EWMH spec: http://standards.freedesktop.org/wm-spec/wm-spec-latest.html The advantage of this path is that the window manager is aware of the window and can handle things like managing input focus and window stacking. The disadvantage of this is that the current window manager implementations leave the desktop resolution alone and resize the window to match the desktop size. The legacy fullscreen support is used if the window manager doesn't support the _NET_WM protocol, the XVidTune extension is enabled, or the SDL_VIDEO_X11_LEGACY_FULLSCREEN environment variable is set to 1. The advantage of this path is that it usually works and you can change resolution out from under the window manager. The disadvantage is that in order to do so it needs to grab input and it doesn't play well with others. Oh, and if your program crashes the desktop is left in a really bad state. I've done a bunch of testing and it seems like the _NET_WM_STATE_FULLSCREEN support works very well on various window managers and I recommend using it if possible. Using the XVidTune extension can really hose compositing window managers, and using XRandR causes the desktop to be reorganized and windows to be resized since the window manager doesn't know it's a temporary resolution change. Ryan is putting together a NetWM protocol proposal for a new fullscreen state which allows the window manager to handle the display resolution changes appropriately. This will combine the best of both worlds where the application can get the resolution it expects, the window manager can prevent the desktop from being reorganized by a resolution change, and if the application crashes the window manager can seamlessly restore the desktop resolution. Cheers! --Sam |
|||||||||||
|
Fullscreen support on X11 |
gabomdq
|
2012/9/30 Sam Lantinga
Do you know if/how this works with the Xinerama/Twinview/Xrandr changes I'm making under bug #1571? -- Gabriel. |
|||||||||||||
|