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

Improper window resized event generated when toggling fullscreen on Mac OS X #1994

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

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.0
Reported for operating system, platform: Mac OS X (All), x86_64

Comments on the original bug report:

On 2015-10-10 22:14:26 +0000, Joshua Bodine wrote:

This issue was introduced in revision 9790 "Hack to fix missing window decorations after toggling fullscreen mode in Mac OS X 10.10." Upon destroying a fullscreen window and creating a new windowed one, a SDL_WINDOWEVENT_RESIZED is generated with the height and width of the display, not of the newly created window. Prior to that revision, it appears no SDL_WINDOWEVENT_RESIZED was generated at all upon window destruction/re-creation.

This is partially a shortcoming in our code (the BZFlag game), but when our program receives this event, it thinks the display resolution is the needed window resolution and tries to do another resize, after which another SDL_WINDOWEVENT_RESIZED is generated with the same width and a slightly reduced height so that the window fits in between the dock and menu at the top. The end result is that when we toggle from fullscreen to windowed mode, the desired resolution is ignored and the window ends up filling the whole display (except for the dock and menu bar).

On 2015-10-11 17:23:33 +0000, Alex Szpakowski wrote:

You might be able to work around the issue in BZFlag's code by erasing all pending window events after destroying the window. (Or selectively erasing any pending window events that have the same window ID as the destroyed window, if you ever use multiple windows.)

SDL_FlushEvent(SDL_WINDOWEVENT) will do the former.

On 2020-04-25 00:33:12 +0000, Joshua Bodine wrote:

This bug now appears to be fixed in the latest SDL 2 version.

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