Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window size limit calculation issue when exiting fullscreen on Windows #1050

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Window size limit calculation issue when exiting fullscreen on Windows #1050

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

@SDLBugzilla SDLBugzilla commented Feb 10, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Windows (All), All

Comments on the original bug report:

On 2013-08-28 10:32:11 +0000, wrote:

Created attachment 1308
Small testcase that shows a resize issue when exiting fullscreen.

When making a non-resizable window exit fullscreen (more specifically this was noticed SDL_WINDOW_FULLSCREEN_DESKTOP), the Windows function SetWindowPos generates a WM_GETMINMAXINFO event and SDL calculates a minimum and maximum size which seems to be wrong.

http://hg.libsdl.org/SDL/file/e8916fe9cfc8/src/video/windows/SDL_windowsevents.c#l415

It gets the old width and height (the fullscreen size in this case) of the window, adjusts it for the window style and then uses those values as the limit for non-resizable windows. This obviously prevents any resizing in this case.

The WM_GETMINMAXINFO is apparently only generated for some of the Windows window styles.

Why does the code change the values of the MINMAXINFO structure when there are no limits set by the user? Why does it touch the values for maximized windows at all? If I'm understanding it correctly, those are not of interest if it's not a resizable window.

Perhaps it should do something similar like it already does for resizable windows?

Attached is a small testcase. After toggling out of fullscreen, the window size stays at the fullscreen size and not the expected 640x480.

On 2013-08-28 10:33:03 +0000, wrote:

Hey, attaching the file worked! :)

On 2013-10-22 14:34:54 +0000, wrote:

This happens on OSX as well; but strangely, not in Linux.

Also see bug # 1962 that I opened on this issue earlier.

On 2013-10-22 14:35:44 +0000, Alex Szpakowski wrote:

It doesn't happen in OS X.

On 2013-10-22 14:43:28 +0000, wrote:

I just confirm similar behavior on OSX 10.6 (with SDL 2.0.0): exiting fullscreen will send a resize command to make the window the maximum dimensions on the desktop it can be (with the window decorations), even if the previous window size was really small.

Perhaps the code path is different, but the effect is the same.

On 2013-10-22 14:44:34 +0000, Alex Szpakowski wrote:

There were several OS X-specific bugs related to switching out of fullscreen fixed already for 2.0.1. Can you test with that please? :)

On 2013-10-22 15:16:19 +0000, wrote:

just verified in rev. cee8a400dc51 on OSX 10.6. Same behavior. However my application needs to respond to external window size changes (e.g. being resized by the user).

I'll continue my responses in my bug as it might be different than this, even though behavior is similar (and this Windows-only).

On 2013-10-22 15:48:34 +0000, Alex Szpakowski wrote:

buckyballreaction: I cannot reproduce this myself on either Mac OS 10.8 or Mac OS 10.6. It works fine for me. Are you using the code attached in this issue report to test?

On 2013-11-10 22:10:53 +0000, Sam Lantinga wrote:

Fixed, thanks!
https://hg.libsdl.org/SDL/rev/7c249ca44069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant