From 8cd88ddf610d14064378df7d4759f64fb1647a43 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 13 Aug 2014 09:15:48 +0200 Subject: [PATCH] Cleanup of OS X cursor fixes. Closes #334. Fixes #254. --- README.md | 1 + src/cocoa_window.m | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c9a8fa28..7ffa12f9 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ GLFW bundles a number of dependencies in the `deps/` directory. - [Cocoa] Bugfix: Modifier key events were lost if the corresponding modifier bit field was unchanged - [Cocoa] Bugfix: Joystick enumeration took hundreds of ms on some systems + - [Cocoa] Bugfix: The cursor was hidden when the user resized a GLFW window - [Win32] Enabled generation of pkg-config file for MinGW - [Win32] Bugfix: Failure to load winmm or its functions was not reported to the error callback diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 8e952bc5..ad48dfe0 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -58,11 +58,10 @@ static NSCursor* getModeCursor(_GLFWwindow* window) // static void updateModeCursor(_GLFWwindow* window) { - // This is required for the cursor to update if cursor is inside the window - NSCursor* cursor = getModeCursor(window); - [cursor set]; + // This is required for the cursor to update if it's inside the window + [getModeCursor(window) set]; - // This is required for the cursor to update if cursor is outside the window + // This is required for the cursor to update if it's outside the window [window->ns.object invalidateCursorRectsForView:window->ns.view]; } @@ -687,9 +686,7 @@ static int translateKey(unsigned int key) - (void)resetCursorRects { - NSCursor* cursor = getModeCursor(window); - - [self addCursorRect:[self bounds] cursor:cursor]; + [self addCursorRect:[self bounds] cursor:getModeCursor(window)]; } - (NSDragOperation)draggingEntered:(id )sender