From edd423aad60abeea2e9dd995a5a1f5c6726be658 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 23 Oct 2021 13:06:47 +0530 Subject: [PATCH] macOS; Fix restoring from fullscreen when resize increments are enabled --- glfw/cocoa_window.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index b7e41e15f..b8296f1c9 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1601,7 +1601,11 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, const GLFWIMEUpdateEvent *ev) { { if (glfw_window && glfw_window->ns.toggleFullscreenCallback && glfw_window->ns.toggleFullscreenCallback((GLFWwindow*)glfw_window) == 1) return; + // When resizeIncrements is set, Cocoa cannot restore the original window size after returning from fullscreen. + const NSSize original = [self resizeIncrements]; + [self setResizeIncrements:NSMakeSize(1.0, 1.0)]; [super toggleFullScreen:sender]; + [self setResizeIncrements:original]; } @end