You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like in certain conditions on exiting fullscreen, SDL can trigger what seems to be a peculiar macOS bug, resulting in the window being moved to an incorrect position. It's consistently happening on my ultra wide monitor when I toggle fullscreen using the green title bar button or the Enter/Exit Full Screen menu item.
Interestingly, it's rare (but still reproducible) when I use SDL_WaitEvent instead of SDL_PollEvent, or when I use SDL_SetWindowFullscreen to toggle fullscreen.
Here's a video illustrating the problem:
toggle-fullscreen-720p.mov
I've debugged this and discovered that the issue occurs because in some cases the [NSMenu setMenuBarVisible:YES]; call in windowDidExitFullScreen: makes Cocoa call windowDidMove: with an incorrectly set window frame. [nswindow frame] in windowDidExitFullScreen: right before that setMenuBarVisible: call is correct.
Here's a screenshot of the call stack:
Calling [NSMenu setMenuBarVisible:YES] in windowDidExitFullScreen: only if [NSMenu menuBarVisible] is false works around this problem and hopefully is an acceptable solution. I will create a pull request with that change shortly.
Also, this is possibly related to, or even a duplicate of #8191, but since this is happening on my single monitor, I've decided to open a new issue.
It looks like in certain conditions on exiting fullscreen, SDL can trigger what seems to be a peculiar macOS bug, resulting in the window being moved to an incorrect position. It's consistently happening on my ultra wide monitor when I toggle fullscreen using the green title bar button or the Enter/Exit Full Screen menu item.
Interestingly, it's rare (but still reproducible) when I use SDL_WaitEvent instead of SDL_PollEvent, or when I use SDL_SetWindowFullscreen to toggle fullscreen.
Here's a video illustrating the problem:
toggle-fullscreen-720p.mov
I've debugged this and discovered that the issue occurs because in some cases the [NSMenu setMenuBarVisible:YES]; call in windowDidExitFullScreen: makes Cocoa call windowDidMove: with an incorrectly set window frame. [nswindow frame] in windowDidExitFullScreen: right before that setMenuBarVisible: call is correct.
Here's a screenshot of the call stack:
Calling [NSMenu setMenuBarVisible:YES] in windowDidExitFullScreen: only if [NSMenu menuBarVisible] is false works around this problem and hopefully is an acceptable solution. I will create a pull request with that change shortly.
Also, this is possibly related to, or even a duplicate of #8191, but since this is happening on my single monitor, I've decided to open a new issue.