From 72f283e7f774313dffcae1b1e9b59a0552ab8fa8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 10 Jul 2023 19:33:25 +0530 Subject: [PATCH] macOS: Fix a regression that caused rendering to hang when transitioning to full screen with macos_colorspace set to default YACOB (Yet Another COcoa Bug) Fixes #6435 --- docs/changelog.rst | 5 +++++ glfw/cocoa_window.m | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 6aaa517c9..0bfc0004f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -35,6 +35,11 @@ mouse anywhere in the current command to move the cursor there. See Detailed list of changes ------------------------------------- +0.29.1 [future] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- macOS: Fix a regression that caused rendering to hang when transitioning to full screen with :opt:`macos_colorspace` set to ``default`` (:iss:`6435`) + 0.29.0 [2023-07-10] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 88ef8c47d..36cebbbb6 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -3026,13 +3026,9 @@ GLFWAPI void glfwCocoaSetWindowChrome(GLFWwindow *w, unsigned int color, bool us switch (color_space) { case SRGB_COLORSPACE: cs = [NSColorSpace sRGBColorSpace]; break; case DISPLAY_P3_COLORSPACE: cs = [NSColorSpace displayP3ColorSpace]; break; - case DEFAULT_COLORSPACE: cs = [NSColorSpace deviceRGBColorSpace]; break; + case DEFAULT_COLORSPACE: cs = nil; break; // using deviceRGBColorSpace causes a hang when transitioning to fullscreen } window->resizable = resizable; - [window->ns.object setColorSpace:cs]; - [[window->ns.object standardWindowButton: NSWindowCloseButton] setHidden:hide_titlebar_buttons]; - [[window->ns.object standardWindowButton: NSWindowMiniaturizeButton] setHidden:hide_titlebar_buttons]; - [[window->ns.object standardWindowButton: NSWindowZoomButton] setHidden:hide_titlebar_buttons]; debug( "Window Chrome state:\n\tbackground: %s\n\tappearance: %s color_space: %s\n\t" "blur: %d has_shadow: %d resizable: %d decorations: %s (%d)\n\t" @@ -3044,6 +3040,10 @@ GLFWAPI void glfwCocoaSetWindowChrome(GLFWwindow *w, unsigned int color, bool us background_blur, has_shadow, resizable, decorations_desc, window->decorated, titlebar_transparent, show_text_in_titlebar, window->ns.titlebar_hidden, hide_titlebar_buttons ); + [window->ns.object setColorSpace:cs]; + [[window->ns.object standardWindowButton: NSWindowCloseButton] setHidden:hide_titlebar_buttons]; + [[window->ns.object standardWindowButton: NSWindowMiniaturizeButton] setHidden:hide_titlebar_buttons]; + [[window->ns.object standardWindowButton: NSWindowZoomButton] setHidden:hide_titlebar_buttons]; window->ns.pre_full_screen_style_mask = getStyleMask(window); [window->ns.object setStyleMask:window->ns.pre_full_screen_style_mask]; // HACK: Changing the style mask can cause the first responder to be cleared