Windows in x11 backend (sdl 1.2)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I’ve encountered some problems which led me in investigating the X11
implementation. There seems to be three different windows, WMwindow
FSwindow and SDL_Window. To me it seems that FSwindow is
OverrideRedirect one, WMwindow is usual one and SDL_Window is a child
window for those and a window for SDL operations.

As I don’t know the history of X11 implementation, could somebody who
knows tell me what were the reasons behind this? The need of
OverrideRedirect window for fullscreen modes? Something else?

The reason why I am asking this is that I would like to get rid of the
extra windows and only have SDL_Window, using _NET_WM_STATE_FULLSCREEN
atom to toggle the fullscreen mode (in my own branch of sdl for one
certain embedded platform). Currently I have changed behavior of the
FSwindow to be managed fullscreen window instead of OverrideRedirect
one. This was done because of problems caused by popping-over windows
and the window manager (if somebody is interested, i can give more
details).

Another question is that if there is no good reasons behind this
three-window system, would the mainstream be interested in a patch
turning the 1.2 x11 backend into single-window based?

  • – Kuisma

PS If somebody wants to ask the src of the modified SDL it’s here:

https://stage.maemo.org/svn/maemo/projects/haf/trunk/libsdl1.2/

(Beware of dirty hacks in there.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFFXcoKHIcMorDK+qsRAr3OAJ0XIo+9sQhsmDTfTKkDRmwcPq4tsACdGIm8
b5lJt6QSqObNSM/oOnQCm/Q=
=JKWN
-----END PGP SIGNATURE-----

Another question is that if there is no good reasons behind this
three-window system, would the mainstream be interested in a patch
turning the 1.2 x11 backend into single-window based?

I would be extremely hesitant to apply any more large patches to the
X11 code in 1.2…it’s being rewritten for 1.3, so cleaning something up
in 1.2 without a clear benefit to most users is asking for trouble.

I didn’t write the X11 code in SDL, but as I understand it, every
strange thing it does was due to some platform, X server, or window
manager with a unique bug or incompatibility.

–ryan.

Another question is that if there is no good reasons behind this
three-window system, would the mainstream be interested in a patch
turning the 1.2 x11 backend into single-window based?

I would be extremely hesitant to apply any more large patches to the
X11 code in 1.2…it’s being rewritten for 1.3, so cleaning something up
in 1.2 without a clear benefit to most users is asking for trouble.

I didn’t write the X11 code in SDL, but as I understand it, every
strange thing it does was due to some platform, X server, or window
manager with a unique bug or incompatibility.

Yep. In this particular case, there were many window managers at the
time the code was written that didn’t support switching a window from
fullscreen to windowed (well, or sometimes at all). The only system
which worked was the three window system you see there. It’s also the
reason that SDL was the only library that I know of that supported
seamless transition between windowed and fullscreen mode on Linux.

At this point any future work should be done in the SDL 1.3 codebase,
and I’d love for you to take a look and see what needs to be done there
for windowed/fullscreen transition.

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment