macOS: Ensure stored mouse position is correct when switching to a kitty window

Fixes #1103
This commit is contained in:
Kovid Goyal 2018-10-31 08:38:50 +05:30
parent e460866ebc
commit e99b1be023
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -455,6 +455,12 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
_glfwInputWindowFocus(window, GLFW_TRUE); _glfwInputWindowFocus(window, GLFW_TRUE);
updateCursorMode(window); updateCursorMode(window);
if (_glfw.ns.disabledCursorWindow != window && cursorInClientArea(window))
{
double x = 0, y = 0;
_glfwPlatformGetCursorPos(window, &x, &y);
_glfwInputCursorPos(window, x, y);
}
} }
- (void)windowDidResignKey:(NSNotification *)notification - (void)windowDidResignKey:(NSNotification *)notification