From 998cb5144e3b69bfc141df302edc048c86f7c7dc Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 22 Nov 2012 17:20:16 +0100 Subject: [PATCH] Made glfwSetCursorPos fail silently if lacking focus. --- include/GL/glfw3.h | 5 +---- src/init.c | 2 -- src/input.c | 3 --- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h index 4b55ddfe..ce968823 100644 --- a/include/GL/glfw3.h +++ b/include/GL/glfw3.h @@ -674,12 +674,9 @@ extern "C" { * more specific categories. */ #define GLFW_PLATFORM_ERROR 0x00070008 -/*! @brief The specified window needed to be focused for the call to succeed. - */ -#define GLFW_WINDOW_NOT_FOCUSED 0x00070009 /*! @brief The clipboard did not contain data in the requested format. */ -#define GLFW_FORMAT_UNAVAILABLE 0x0007000A +#define GLFW_FORMAT_UNAVAILABLE 0x00070009 /*! @} */ /*! @brief The number of entries in the gamma ramp. diff --git a/src/init.c b/src/init.c index fd7d5833..e0a919c2 100644 --- a/src/init.c +++ b/src/init.c @@ -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"; } diff --git a/src/input.c b/src/input.c index 787103a8..2a077502 100644 --- a/src/input.c +++ b/src/input.c @@ -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)