mirror of
https://github.com/glfw/glfw.git
synced 2026-08-29 03:04:14 +02:00
Made glfwSetCursorPos fail silently if lacking focus.
This commit is contained in:
@@ -228,8 +228,6 @@ GLFWAPI const char* glfwErrorString(int error)
|
||||
return "The requested OpenGL version is unavailable";
|
||||
case GLFW_PLATFORM_ERROR:
|
||||
return "A platform-specific error occurred";
|
||||
case GLFW_WINDOW_NOT_FOCUSED:
|
||||
return "The specified window is not focused";
|
||||
case GLFW_FORMAT_UNAVAILABLE:
|
||||
return "The requested format is unavailable";
|
||||
}
|
||||
|
||||
@@ -408,10 +408,7 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow handle, int xpos, int ypos)
|
||||
}
|
||||
|
||||
if (_glfwLibrary.focusedWindow != window)
|
||||
{
|
||||
_glfwSetError(GLFW_WINDOW_NOT_FOCUSED, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't do anything if the cursor position did not change
|
||||
if (xpos == window->cursorPosX && ypos == window->cursorPosY)
|
||||
|
||||
Reference in New Issue
Block a user