From fdc9835587df32481c9a37d25d8ba5a407b3aa4a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 18 Feb 2022 13:44:25 +0530 Subject: [PATCH] Cleanup previous PR --- docs/changelog.rst | 4 ++-- glfw/cocoa_platform.h | 2 +- glfw/cocoa_window.m | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 5ffa2131c..272fde7b9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -144,9 +144,9 @@ Detailed list of changes - Add an option :opt:`wheel_scroll_min_lines` to set the minimum number of lines for mouse wheel scrolling when using a mouse with a wheel that generates very small offsets when slow scrolling (:pull:`4710`) -- macOS: Allows to configure the toggle fullscreen shortcut in global menu. (:pull:`4714`) +- macOS: Make the shortcut to toggle full screen configurable (:pull:`4714`) -- macOS: Fix the mouse cursor being set to arrow after switching desktops or toggling fullscreen. (:pull:`4716`) +- macOS: Fix the mouse cursor being set to arrow after switching desktops or toggling full screen (:pull:`4716`) 0.24.2 [2022-02-03] diff --git a/glfw/cocoa_platform.h b/glfw/cocoa_platform.h index 6b162d7d9..96a3216e2 100644 --- a/glfw/cocoa_platform.h +++ b/glfw/cocoa_platform.h @@ -155,7 +155,7 @@ typedef struct _GLFWwindowNS bool renderFrameRequested; GLFWcocoarenderframefun renderFrameCallback; // update cursor after switching desktops with Mission Control - bool initialCursorUpdateRequested; + bool delayed_cursor_update_requested; } _GLFWwindowNS; typedef struct _GLFWDisplayLinkNS diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 6ef402cb2..188ea4792 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -582,7 +582,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; } - (instancetype)initWithGlfwWindow:(_GLFWwindow *)initWindow; -- (void)requestInitialCursorUpdate:(id)sender; +- (void)request_delayed_cursor_update:(id)sender; @end @@ -695,7 +695,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; } // macOS will send a delayed event to update the cursor to arrow after switching desktops. // So we need to delay and update the cursor once after that. - [self performSelector:@selector(requestInitialCursorUpdate:) withObject:nil afterDelay:0.3]; + [self performSelector:@selector(request_delayed_cursor_update:) withObject:nil afterDelay:0.3]; } - (void)windowDidResignKey:(NSNotification *)notification @@ -726,10 +726,10 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; } } -- (void)requestInitialCursorUpdate:(id)sender +- (void)request_delayed_cursor_update:(id)sender { (void)sender; - if (window) window->ns.initialCursorUpdateRequested = true; + if (window) window->ns.delayed_cursor_update_requested = true; } - (void)windowWillEnterFullScreen:(NSNotification *)notification @@ -742,7 +742,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; { (void)notification; if (window) window->ns.in_fullscreen_transition = false; - [self performSelector:@selector(requestInitialCursorUpdate:) withObject:nil afterDelay:0.3]; + [self performSelector:@selector(request_delayed_cursor_update:) withObject:nil afterDelay:0.3]; } - (void)windowWillExitFullScreen:(NSNotification *)notification @@ -755,7 +755,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; { (void)notification; if (window) window->ns.in_fullscreen_transition = false; - [self performSelector:@selector(requestInitialCursorUpdate:) withObject:nil afterDelay:0.3]; + [self performSelector:@selector(request_delayed_cursor_update:) withObject:nil afterDelay:0.3]; } @end // }}} @@ -941,8 +941,8 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; window->ns.cursorWarpDeltaX = 0; window->ns.cursorWarpDeltaY = 0; - if (window->ns.initialCursorUpdateRequested) { - window->ns.initialCursorUpdateRequested = false; + if (window->ns.delayed_cursor_update_requested) { + window->ns.delayed_cursor_update_requested = false; if (cursorInContentArea(window)) updateCursorImage(window); } }