The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Bug in SDL2 RC2 under Visual studio 2008
neoaggelos


Joined: 02 Jan 2013
Posts: 138
With SDL2 RC2, creating a window under Windows XP at position 0,0 will position the window border off-screen.

Linking with rc2 of SDL2 under Visual Studio 2008.
Bug in SDL2 RC2 under Visual studio 2008
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
This actually isn't technically a bug, since the window position is in terms of the client area, and there aren't API functions to get the window border size.

I agree it's not ideal though and am open to suggestions.



On Tue, Jun 11, 2013 at 3:06 AM, neoaggelos wrote:
Quote:
With SDL2 RC2, creating a window under Windows XP at position 0,0 will position the window border off-screen.

Linking with rc2 of SDL2 under Visual Studio 2008.



C is the God's Programming Language


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Bug in SDL2 RC2 under Visual studio 2008
Andreas Schiffler
Guest

As per web-search wisdom, one CAN get the border size (and thus could automatically adjust the position away from 0,0 accordingly).

On XP one can use GetWindowRect (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms633519%28v=vs.85%29.aspx). On Vista and above OS's it is more complicated. One needs to dynamically bind to dwmapi.dll, use GetProcAddress() to obtain the DwmGetWindowAttribute() function (see http://msdn.microsoft.com/en-us/library/windows/desktop/aa969515%28v=vs.85%29.aspx), then call it with the DWMWA_EXTENDED_FRAME_BOUNDS argument to request the genuine window frame dimensions.

Here is some working Python code to illustrate this: http://stackoverflow.com/questions/3192232/getwindowrect-too-small-on-windows-7

In either case one would need to create the window off screen, query for the framesize and then position with the framesize as fudge factor.

What are the positioning behaviors across other platforms? Client area or client+frame area?


On 6/12/2013 10:22 PM, Sam Lantinga wrote:

Quote:
This actually isn't technically a bug, since the window position is in terms of the client area, and there aren't API functions to get the window border size.

I agree it's not ideal though and am open to suggestions.



On Tue, Jun 11, 2013 at 3:06 AM, neoaggelos wrote:
Quote:
With SDL2 RC2, creating a window under Windows XP at position 0,0 will position the window border off-screen.

Linking with rc2 of SDL2 under Visual Studio 2008.



C is the God's Programming Language


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org






Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Bug in SDL2 RC2 under Visual studio 2008
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Sorry, to clarify, there aren't _SDL_ functions to get the window borders. :)

The positioning behavior is (should be) client area across all platforms.



On Wed, Jun 12, 2013 at 10:44 PM, Andreas Schiffler wrote:
Quote:
As per web-search wisdom, one CAN get the border size (and thus could automatically adjust the position away from 0,0 accordingly).

On XP one can use GetWindowRect (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms633519%28v=vs.85%29.aspx). On Vista and above OS's it is more complicated. One needs to dynamically bind to dwmapi.dll, use GetProcAddress() to obtain the DwmGetWindowAttribute() function (see http://msdn.microsoft.com/en-us/library/windows/desktop/aa969515%28v=vs.85%29.aspx), then call it with the DWMWA_EXTENDED_FRAME_BOUNDS argument to request the genuine window frame dimensions.

Here is some working Python code to illustrate this: http://stackoverflow.com/questions/3192232/getwindowrect-too-small-on-windows-7

In either case one would need to create the window off screen, query for the framesize and then position with the framesize as fudge factor.

What are the positioning behaviors across other platforms? Client area or client+frame area?


On 6/12/2013 10:22 PM, Sam Lantinga wrote:



Quote:
This actually isn't technically a bug, since the window position is in terms of the client area, and there aren't API functions to get the window border size.

I agree it's not ideal though and am open to suggestions.



On Tue, Jun 11, 2013 at 3:06 AM, neoaggelos wrote:
Quote:
With SDL2 RC2, creating a window under Windows XP at position 0,0 will position the window border off-screen.

Linking with rc2 of SDL2 under Visual Studio 2008.



C is the God's Programming Language


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org






Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




Bug in SDL2 RC2 under Visual studio 2008
Andreas Schiffler
Guest

This may be a good candidate for a new SDL 2.1 API - either in the form of a special window creation flag that adjusts the position according to the frame size and/or a function operating on an existing window that returns the framesize.

On 6/12/2013 10:46 PM, Sam Lantinga wrote:

Quote:
Sorry, to clarify, there aren't _SDL_ functions to get the window borders. Smile

The positioning behavior is (should be) client area across all platforms.



On Wed, Jun 12, 2013 at 10:44 PM, Andreas Schiffler wrote:
Quote:
As per web-search wisdom, one CAN get the border size (and thus could automatically adjust the position away from 0,0 accordingly).

On XP one can use GetWindowRect (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms633519%28v=vs.85%29.aspx). On Vista and above OS's it is more complicated. One needs to dynamically bind to dwmapi.dll, use GetProcAddress() to obtain the DwmGetWindowAttribute() function (see http://msdn.microsoft.com/en-us/library/windows/desktop/aa969515%28v=vs.85%29.aspx), then call it with the DWMWA_EXTENDED_FRAME_BOUNDS argument to request the genuine window frame dimensions.

Here is some working Python code to illustrate this: http://stackoverflow.com/questions/3192232/getwindowrect-too-small-on-windows-7

In either case one would need to create the window off screen, query for the framesize and then position with the framesize as fudge factor.

What are the positioning behaviors across other platforms? Client area or client+frame area?


On 6/12/2013 10:22 PM, Sam Lantinga wrote:



Quote:
This actually isn't technically a bug, since the window position is in terms of the client area, and there aren't API functions to get the window border size.

I agree it's not ideal though and am open to suggestions.



On Tue, Jun 11, 2013 at 3:06 AM, neoaggelos wrote:
Quote:
With SDL2 RC2, creating a window under Windows XP at position 0,0 will position the window border off-screen.

Linking with rc2 of SDL2 under Visual Studio 2008.



C is the God's Programming Language


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org






Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org