1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-10-07 22:57:25 -04:00

Fixed hidden cursor positioning corner case.

This commit is contained in:
Andri Pálsson 2013-10-09 19:03:47 +02:00 committed by Camilla Berglund
parent 0e7c6e1d82
commit 99784fb8f0
3 changed files with 8 additions and 4 deletions

View File

@ -221,6 +221,8 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/).
with Xcode 5
- [Cocoa] Bugfix: Use of undeclared selectors with `@selector` caused warnings
with Xcode 5
- [Cocoa] Bugfix: The cursor remained visible if moved onto client area after
having been set to hidden outside it
- [X11] Added setting of the `WM_CLASS` property to the initial window title
@ -296,6 +298,7 @@ skills.
- Pierre Moulon
- Julian Møller
- Ozzy
- Andri Pálsson
- Peoro
- Braden Pellett
- Arturo J. Pérez

View File

@ -1051,6 +1051,8 @@ void _glfwPlatformWaitEvents(void)
void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
{
setModeCursor(window, window->cursorMode);
if (window->monitor)
{
CGDisplayMoveCursorToPoint(window->monitor->ns.displayID,

View File

@ -35,7 +35,7 @@
//
static void setCursorMode(_GLFWwindow* window, int newMode)
{
int oldMode;
const int oldMode = window->cursorMode;
if (newMode != GLFW_CURSOR_NORMAL &&
newMode != GLFW_CURSOR_HIDDEN &&
@ -45,10 +45,11 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
return;
}
oldMode = window->cursorMode;
if (oldMode == newMode)
return;
window->cursorMode = newMode;
if (window == _glfw.focusedWindow)
{
if (oldMode == GLFW_CURSOR_DISABLED)
@ -71,8 +72,6 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
_glfwPlatformSetCursorMode(window, newMode);
}
window->cursorMode = newMode;
}
// Set sticky keys mode for the specified window