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
Wrong window size on Windows 8
slimshader


Joined: 26 Apr 2013
Posts: 39
Hi,

I have a run-time problem on Windows 8 with SDL 2.0.3: window created is not of the requested size. For example calling SDL_CreateWindow() with width == 100 and height == 100 results in window that reports (via SDL_GetWindowSize()) dimensions 162 x 100 respectively.
Wrong window size on Windows 8
Melker Narikka
Guest

Hey,

could that have something to do with the title bar requiring a certain window width?
Maybe set the SDL_WINDOW_RESIZABLE flag on window creation and see what
the smallest size you can get to is. You could also play with SDL_WINDOW_BORDERLESS.


--
Melker Narikka



On Tue, Aug 19, 2014 at 11:28 PM, slimshader wrote:
Quote:
Hi,

I have a run-time problem on Windows 8 with SDL 2.0.3: window created is not of the requested size. For example calling SDL_CreateWindow() with width == 100 and height == 100 results in window that reports (via SDL_GetWindowSize()) dimensions 162 x 100 respectively.


_______________________________________________
SDL mailing list

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

Wrong window size on Windows 8
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
There's a minimum windows size on certain operating systems. In this case, that's the minimum width for a decorated window, so if you really need to be that size, try using the borderless flag?



On Tue, Aug 19, 2014 at 1:34 PM, Melker Narikka wrote:
Quote:
Hey,

could that have something to do with the title bar requiring a certain window width?
Maybe set the SDL_WINDOW_RESIZABLE flag on window creation and see what
the smallest size you can get to is. You could also play with SDL_WINDOW_BORDERLESS.


--
Melker Narikka



On Tue, Aug 19, 2014 at 11:28 PM, slimshader wrote:

Quote:
Hi,

I have a run-time problem on Windows 8 with SDL 2.0.3: window created is not of the requested size. For example calling SDL_CreateWindow() with width == 100 and height == 100 results in window that reports (via SDL_GetWindowSize()) dimensions 162 x 100 respectively.



_______________________________________________
SDL mailing list

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





_______________________________________________
SDL mailing list

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

Re: Wrong window size on Windows 8
slimshader


Joined: 26 Apr 2013
Posts: 39
That was actually bad example on my side, I quickly checked with 100x100 to see if problem sis there too but real problem I have (my customers actually) is actually different.

Widow is being created with size 1024x768. After that checking window size with GetWindowSize() reports correct (1024x768) size. But window size is not actually that. Measuring size of inner canvas (inside borders etc) gives area of 1280 x 960. This causes problems for my customers because they have to run in 1600x900 to get 1920x1080 window.

Any ideas? That happens only on (as far as I know) Win8 btw and Intel 4000 graphics.


Sam Lantinga wrote:
There's a minimum windows size on certain operating systems. In this case, that's the minimum width for a decorated window, so if you really need to be that size, try using the borderless flag?



On Tue, Aug 19, 2014 at 1:34 PM, Melker Narikka wrote:
Quote:
Hey,

could that have something to do with the title bar requiring a certain window width?
Maybe set the SDL_WINDOW_RESIZABLE flag on window creation and see what
the smallest size you can get to is. You could also play with SDL_WINDOW_BORDERLESS.


--
Melker Narikka



On Tue, Aug 19, 2014 at 11:28 PM, slimshader wrote:

Quote:
Hi,

I have a run-time problem on Windows 8 with SDL 2.0.3: window created is not of the requested size. For example calling SDL_CreateWindow() with width == 100 and height == 100 results in window that reports (via SDL_GetWindowSize()) dimensions 162 x 100 respectively.



_______________________________________________
SDL mailing list

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





_______________________________________________
SDL mailing list

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

Wrong window size on Windows 8
László Boros
Guest

On high DPI monitors Windows stretches its windows, that could cause it. If that's the case, you could see the blurry, not so sharp pixels being stretched. You can disable this behaviour somewhere in the settings.
Could it be your problem?
Laszlo Boros On Aug 20, 2014 10:30 AM, "slimshader" wrote:
Quote:
That was actually bad example on my side, I quickly checked with 100x100 to see if problem sis there too but real problem I have (my customers actually) is actually different.

Widow is being created with size 1024x768. After that checking window size with GetWindowSize() reports correct (1024x768) size. But window size is not actually that. Measuring size of inner canvas (inside borders etc) gives area of 1280 x 960. This causes problems for my customers because they have to run in 1600x900 to get 1920x1080 window.

Any ideas? That happens only on (as far as I know) Win8 btw and Intel 4000 graphics.




Sam Lantinga wrote:


There's a minimum windows size on certain operating systems. In this case, that's the minimum width for a decorated window, so if you really need to be that size, try using the borderless flag?



On Tue, Aug 19, 2014 at 1:34 PM, Melker Narikka <> wrote:


Quote:


Hey,

could that have something to do with the title bar requiring a certain window width?
Maybe set the SDL_WINDOW_RESIZABLE flag on window creation and see what
the smallest size you can get to is. You could also play with SDL_WINDOW_BORDERLESS.


--
Melker Narikka



On Tue, Aug 19, 2014 at 11:28 PM, slimshader <> wrote:



Quote:


Hi,

I have a run-time problem on Windows 8 with SDL 2.0.3: window created is not of the requested size. For example calling SDL_CreateWindow() with width == 100 and height == 100 results in window that reports (via SDL_GetWindowSize()) dimensions 162 x 100 respectively.



_______________________________________________
SDL mailing list

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








_______________________________________________
SDL mailing list

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










_______________________________________________
SDL mailing list

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

Re: Wrong window size on Windows 8
slimshader


Joined: 26 Apr 2013
Posts: 39
László Boros wrote:
On high DPI monitors Windows stretches its windows, that could cause it. If that's the case, you could see the blurry, not so sharp pixels being stretched. You can disable this behaviour somewhere in the settings.
Could it be your problem?

I definately see blurry text on my test machine. Will check the settings. It is normal Full HD laptop tho, nothing fancy high DPI.

Laszlo Boros On Aug 20, 2014 10:30 AM, "slimshader" wrote:
Quote:
That was actually bad example on my side, I quickly checked with 100x100 to see if problem sis there too but real problem I have (my customers actually) is actually different.

Widow is being created with size 1024x768. After that checking window size with GetWindowSize() reports correct (1024x768) size. But window size is not actually that. Measuring size of inner canvas (inside borders etc) gives area of 1280 x 960. This causes problems for my customers because they have to run in 1600x900 to get 1920x1080 window.

Any ideas? That happens only on (as far as I know) Win8 btw and Intel 4000 graphics.




Sam Lantinga wrote:


There's a minimum windows size on certain operating systems. In this case, that's the minimum width for a decorated window, so if you really need to be that size, try using the borderless flag?



On Tue, Aug 19, 2014 at 1:34 PM, Melker Narikka <> wrote:


Quote:


Hey,

could that have something to do with the title bar requiring a certain window width?
Maybe set the SDL_WINDOW_RESIZABLE flag on window creation and see what
the smallest size you can get to is. You could also play with SDL_WINDOW_BORDERLESS.


--
Melker Narikka



On Tue, Aug 19, 2014 at 11:28 PM, slimshader <> wrote:



Quote:


Hi,

I have a run-time problem on Windows 8 with SDL 2.0.3: window created is not of the requested size. For example calling SDL_CreateWindow() with width == 100 and height == 100 results in window that reports (via SDL_GetWindowSize()) dimensions 162 x 100 respectively.



_______________________________________________
SDL mailing list

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








_______________________________________________
SDL mailing list

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










_______________________________________________
SDL mailing list

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

Re: Wrong window size on Windows 8
slimshader


Joined: 26 Apr 2013
Posts: 39
Yes, disabling DPI compatibility helped. Thanks! I wonder if there is a way to do it programatically.

Followed this advice after yours:

http://social.technet.microsoft.com/Forums/windows/en-US/831ee84b-95a1-437a-b051-b7d51e13ba0f/windows-8-blurryfuzzy-text

slimshader wrote:
László Boros wrote:
On high DPI monitors Windows stretches its windows, that could cause it. If that's the case, you could see the blurry, not so sharp pixels being stretched. You can disable this behaviour somewhere in the settings.
Could it be your problem?

I definately see blurry text on my test machine. Will check the settings. It is normal Full HD laptop tho, nothing fancy high DPI.

Laszlo Boros On Aug 20, 2014 10:30 AM, "slimshader" wrote:
Quote:
That was actually bad example on my side, I quickly checked with 100x100 to see if problem sis there too but real problem I have (my customers actually) is actually different.

Widow is being created with size 1024x768. After that checking window size with GetWindowSize() reports correct (1024x768) size. But window size is not actually that. Measuring size of inner canvas (inside borders etc) gives area of 1280 x 960. This causes problems for my customers because they have to run in 1600x900 to get 1920x1080 window.

Any ideas? That happens only on (as far as I know) Win8 btw and Intel 4000 graphics.




Sam Lantinga wrote:


There's a minimum windows size on certain operating systems. In this case, that's the minimum width for a decorated window, so if you really need to be that size, try using the borderless flag?



On Tue, Aug 19, 2014 at 1:34 PM, Melker Narikka <> wrote:


Quote:


Hey,

could that have something to do with the title bar requiring a certain window width?
Maybe set the SDL_WINDOW_RESIZABLE flag on window creation and see what
the smallest size you can get to is. You could also play with SDL_WINDOW_BORDERLESS.


--
Melker Narikka



On Tue, Aug 19, 2014 at 11:28 PM, slimshader <> wrote:



Quote:


Hi,

I have a run-time problem on Windows 8 with SDL 2.0.3: window created is not of the requested size. For example calling SDL_CreateWindow() with width == 100 and height == 100 results in window that reports (via SDL_GetWindowSize()) dimensions 162 x 100 respectively.



_______________________________________________
SDL mailing list

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








_______________________________________________
SDL mailing list

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










_______________________________________________
SDL mailing list

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

mr_tawan


Joined: 13 Jan 2014
Posts: 161
http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266%28v=vs.85%29.aspx

I don't know if the win32 api included in MINGW or Cygwin contains the required function or not, btw. If you're using Visual Studio, then it should do.

Last time I checked I don't see any Hi-DPI support for Windows in SDL. Are we going to add that ?