macOS: Prevent resizing of fullscreen OS windows as it leads to visual artifacts

This commit is contained in:
Kovid Goyal 2021-10-24 12:38:44 +05:30
parent 4604558d35
commit 0a4dfa8fd2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1845,6 +1845,8 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
} }
else else
{ {
// Disable window resizing in fullscreen.
if ([window->ns.object styleMask] & NSWindowStyleMaskFullScreen || window->ns.in_traditional_fullscreen) return;
NSRect contentRect = NSRect contentRect =
[window->ns.object contentRectForFrameRect:[window->ns.object frame]]; [window->ns.object contentRectForFrameRect:[window->ns.object frame]];
contentRect.origin.y += contentRect.size.height - height; contentRect.origin.y += contentRect.size.height - height;