macOS: manually trigger windowDidResize when fullscreening

Fixes #4230
Fixes #4229
This commit is contained in:
Kovid Goyal 2021-11-13 10:20:57 +05:30
parent 0830e66e76
commit 56e63baf5a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2476,6 +2476,10 @@ bool _glfwPlatformToggleFullscreen(_GLFWwindow* w, unsigned int flags) {
}
[window setStyleMask: sm];
}
// If the dock and menubar are hidden going from maximized to fullscreen doesnt change the window size
// and macOS forgets to trigger windowDidResize, so call it ourselves
NSNotification *notification = [NSNotification notificationWithName:NSWindowDidResizeNotification object:window];
[w->ns.delegate performSelector:@selector(windowDidResize:) withObject:notification afterDelay:0];
} else {
bool in_fullscreen = sm & NSWindowStyleMaskFullScreen;
if (in_fullscreen) made_fullscreen = false;