Wrong window size on Windows 8

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.

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 <szymon.gatner at gmail.com> wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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:

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 <szymon.gatner at gmail.com> wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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 <meklu at meklu.org (meklu at meklu.org)> wrote:

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 <@slimshader (@slimshader)> wrote:

  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
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

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 BorosOn Aug 20, 2014 10:30 AM, “slimshader” <szymon.gatner at gmail.com> wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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” <@slimshader (@slimshader)> wrote:

   	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 (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)


SDL mailing list

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


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

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” <@slimshader (@slimshader)> wrote:

   	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 (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)


SDL mailing list

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


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).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 ?