We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2667 - Windows: SDL_GetWindowSize report wrong value after Fullscreen -> Window toggle.
Summary: Windows: SDL_GetWindowSize report wrong value after Fullscreen -> Window toggle.
Status: RESOLVED ABANDONED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.4
Depends on:
Blocks:
 
Reported: 2014-07-30 12:33 UTC by Andreas
Modified: 2018-08-06 21:20 UTC (History)
1 user (show)

See Also:


Attachments
SDL_windowsmodes.c.patch (810 bytes, patch)
2014-07-30 12:33 UTC, Andreas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas 2014-07-30 12:33:09 UTC
Created attachment 1798 [details]
SDL_windowsmodes.c.patch

After a Fullscreen -> Window toggle using (SDL_WINDOW_FULLSCREEN) the window
reports incorrect size when calling SDL_GetWindowSize. This behavior only occurs 
on Windows.

This can easily be tested by running one of the SDL test programs such as 
'testsprite2'.

Use CTRL + Enter to toggle fullscreen and then fullscreen ->windowed. Here we easily see that the window isn't centered as it should due to incorrect size reported. This can be checked by calling 'SDL_GetWindowSize' after the actual toggle.

Everthing works fine using ALT + Enter which uses SDL_WINDOW_FULLSCREEN_DESKTOP.

I've attached a patch which solves the issue on Windows for me. I've tested the patch and it works fine with both ALT + Enter and CTRL + Enter.

If anyone could have a look at it I would appreciate it.

This is a showstopper bug on Windows and would be great if it's applied in the 2.0.4 release.

Thanks.
Comment 1 Ryan C. Gordon 2015-02-19 05:22:16 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though!
Comment 2 Alex Szpakowski 2015-02-19 19:58:40 UTC
This patch seems to have a bad side-effect: it makes the display momentarily switch modes when the program is quit if a window was fullscreen at one point.

My Windows 8.1 system also doesn't seem to be affected by the reported bug in the first place (using the latest Mercurial code), although it might be specific to certain Windows versions.
Comment 3 Ryan C. Gordon 2015-04-07 04:57:54 UTC
(sorry if you get a lot of copies of this email, I'm marking several bugs at once)

Marking bugs for the (mostly) final 2.0.4 TODO list. This means we're hoping to resolve this bug before 2.0.4 ships if possible. In a perfect world, the open bug count with the target-2.0.4 keyword is zero when we ship.

(Note that closing a bug report as WONTFIX, INVALID or WORKSFORME might still happen.)

--ryan.
Comment 4 Sam Lantinga 2015-05-28 16:58:59 UTC
I think this might have been fixed separately for 2.0.4, I'll ask Andreas to retest once that's released.
Comment 5 Sam Lantinga 2017-08-14 05:18:03 UTC
Andreas, can you confirm that this is fixed for you in the latest SDL snapshot?
http://www.libsdl.org/tmp/SDL-2.0.zip

Thanks!
Comment 6 Ryan C. Gordon 2018-08-06 21:20:19 UTC
Hello, and sorry if you're getting dozens of copies of this message by email.

We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc.

Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report.

So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues.

(please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!)

Thanks,
--ryan.