diff --git a/docs/changelog.rst b/docs/changelog.rst index 28811c394..3efc08e91 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,6 +21,9 @@ To update |kitty|, :doc:`follow the instructions `. - macOS: Add an option :opt:`macos_show_window_title_in_menubar` to not show the current window title in the menu-bar (:iss:`1066`) +- macOS: Workaround for cocoa bug that could cause the mouse cursor to become + hidden in other applications in rare circumstances (:iss:`1218`) + - Fix using remote control to set cursor text color causing errors when creating new windows (:iss:`1326`) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 261d56d69..9766c7602 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -457,6 +457,7 @@ - (void)windowDidBecomeKey:(NSNotification *)notification _glfwInputWindowFocus(window, GLFW_TRUE); updateCursorMode(window); + if (window->cursorMode == GLFW_CURSOR_HIDDEN) hideCursor(window); if (_glfw.ns.disabledCursorWindow != window && cursorInClientArea(window)) { double x = 0, y = 0; @@ -469,6 +470,7 @@ - (void)windowDidResignKey:(NSNotification *)notification { if (window->monitor && window->autoIconify) _glfwPlatformIconifyWindow(window); + showCursor(window); _glfwInputWindowFocus(window, GLFW_FALSE); } @@ -720,17 +722,11 @@ - (void)otherMouseUp:(NSEvent *)event - (void)mouseExited:(NSEvent *)event { - if (window->cursorMode == GLFW_CURSOR_HIDDEN) - showCursor(window); - _glfwInputCursorEnter(window, GLFW_FALSE); } - (void)mouseEntered:(NSEvent *)event { - if (window->cursorMode == GLFW_CURSOR_HIDDEN) - hideCursor(window); - _glfwInputCursorEnter(window, GLFW_TRUE); }