Fixed hidden cursor positioning corner case.
This commit is contained in:
parent
0e7c6e1d82
commit
99784fb8f0
@ -221,6 +221,8 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/).
|
|||||||
with Xcode 5
|
with Xcode 5
|
||||||
- [Cocoa] Bugfix: Use of undeclared selectors with `@selector` caused warnings
|
- [Cocoa] Bugfix: Use of undeclared selectors with `@selector` caused warnings
|
||||||
with Xcode 5
|
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
|
- [X11] Added setting of the `WM_CLASS` property to the initial window title
|
||||||
|
|
||||||
|
|
||||||
@ -296,6 +298,7 @@ skills.
|
|||||||
- Pierre Moulon
|
- Pierre Moulon
|
||||||
- Julian Møller
|
- Julian Møller
|
||||||
- Ozzy
|
- Ozzy
|
||||||
|
- Andri Pálsson
|
||||||
- Peoro
|
- Peoro
|
||||||
- Braden Pellett
|
- Braden Pellett
|
||||||
- Arturo J. Pérez
|
- Arturo J. Pérez
|
||||||
|
@ -1051,6 +1051,8 @@ void _glfwPlatformWaitEvents(void)
|
|||||||
|
|
||||||
void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
|
void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
|
||||||
{
|
{
|
||||||
|
setModeCursor(window, window->cursorMode);
|
||||||
|
|
||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
{
|
{
|
||||||
CGDisplayMoveCursorToPoint(window->monitor->ns.displayID,
|
CGDisplayMoveCursorToPoint(window->monitor->ns.displayID,
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
//
|
//
|
||||||
static void setCursorMode(_GLFWwindow* window, int newMode)
|
static void setCursorMode(_GLFWwindow* window, int newMode)
|
||||||
{
|
{
|
||||||
int oldMode;
|
const int oldMode = window->cursorMode;
|
||||||
|
|
||||||
if (newMode != GLFW_CURSOR_NORMAL &&
|
if (newMode != GLFW_CURSOR_NORMAL &&
|
||||||
newMode != GLFW_CURSOR_HIDDEN &&
|
newMode != GLFW_CURSOR_HIDDEN &&
|
||||||
@ -45,10 +45,11 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
oldMode = window->cursorMode;
|
|
||||||
if (oldMode == newMode)
|
if (oldMode == newMode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
window->cursorMode = newMode;
|
||||||
|
|
||||||
if (window == _glfw.focusedWindow)
|
if (window == _glfw.focusedWindow)
|
||||||
{
|
{
|
||||||
if (oldMode == GLFW_CURSOR_DISABLED)
|
if (oldMode == GLFW_CURSOR_DISABLED)
|
||||||
@ -71,8 +72,6 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
|
|||||||
|
|
||||||
_glfwPlatformSetCursorMode(window, newMode);
|
_glfwPlatformSetCursorMode(window, newMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
window->cursorMode = newMode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set sticky keys mode for the specified window
|
// Set sticky keys mode for the specified window
|
||||||
|
Loading…
Reference in New Issue
Block a user