[SDL] Window/surface dimensions mismatch problem
phillips at arcor.de
Wed Jan 15 08:55:01 PST 2003
On Wednesday 15 January 2003 11:01, Sam Lantinga wrote:
> > I suspect that there is *another* window somehow involved, and that the
> > window being returned to SDL by XCreateWindow is (bizarrely) being
> > clipped to display within that mysterious other window. This is just a
> > theory, and actually, it mainly shows how little I know about X at this
> > point.
> Actually, it sounds like KDE is creating a window on top of the SDL window,
> and GTk knows to look for children... at least that's my impression, I
> haven't actually seen this behavior.
I expect I'll post my demo tomorrow, complete with glitch, then it will be
easy to see.
> It looks like you'll have to dig into the source. :)
> For the record, SDL really is supposed to return a surface the size
> requested. The code in the Windows driver is just to handle the bizzare
> case where the video mode is exactly the size of the screen and Windows
> needs to have a title bar.
I know life would be easier for SDL if you could always create the surface
exactly as the application specified, however, from the horse's mouth:
"A window manager can override your choice of size, border
width, and position for a top-level window. Your program
must be prepared to use the actual size and position of the
top window. It is not acceptable for a client application
to resize itself unless in direct response to a human com-
mand to do so. Instead, either your program should use the
space given to it, or if the space is too small for any use-
ful work, your program might ask the user to resize the win-
dow. The border of your top-level window is considered fair
game for window managers."
(James Gettys, http://ftp.xfree86.org/pub/XFree86/4.2.0/doc/xlib.TXT)
So the Windows situation just left no alternative but to do the right thing,
and similarly, KDE's "store settings" forces that for X.
By the way, I really like SDL, thanks for making it.
More information about the SDL