From d3f5d036f870ab9e13e15d38b79b88382f1ec4eb Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 26 Feb 2016 08:37:30 +0100 Subject: [PATCH] Fix OS X modifier flags cache getting out of date Fixes #566. Closes #567. --- README.md | 1 + src/cocoa_window.m | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 7bac5486..d6d1b06b 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ does not find Doxygen, the documentation will not be generated. - [Cocoa] Removed support for OS X 10.6 - [Cocoa] Bugfix: Full screen windows on secondary monitors were mispositioned - [Cocoa] Bugfix: Connecting a joystick that reports no name would segfault + - [Cocoa] Bugfix: Modifier flags cache was not updated when window became key - [X11] Bugfix: Monitor connection and disconnection events were not reported - [X11] Bugfix: Decoding of UTF-8 text from XIM could continue past the end - [X11] Bugfix: An XKB structure was leaked during `glfwInit` diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 1ad9cc1a..47af1e9a 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -206,6 +206,9 @@ static int translateKey(unsigned int key) - (void)windowDidBecomeKey:(NSNotification *)notification { + window->ns.modifierFlags = + [NSEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; + if (_glfw.cursorWindow == window && window->cursorMode == GLFW_CURSOR_DISABLED) {