mirror of
				https://github.com/glfw/glfw.git
				synced 2025-10-31 12:42:26 +00:00 
			
		
		
		
	Only apply cursor mode to focused windows.
This commit is contained in:
		
							parent
							
								
									037c5ec6f5
								
							
						
					
					
						commit
						f175b2dddc
					
				| @ -52,6 +52,8 @@ static void setCursorMode(_GLFWwindow* window, int newMode) | ||||
|     if (oldMode == newMode) | ||||
|         return; | ||||
| 
 | ||||
|     if (window == _glfw.focusedWindow) | ||||
|     { | ||||
|         if (oldMode == GLFW_CURSOR_CAPTURED) | ||||
|             _glfwPlatformSetCursorPos(window, _glfw.cursorPosX, _glfw.cursorPosY); | ||||
|         else if (newMode == GLFW_CURSOR_CAPTURED) | ||||
| @ -66,6 +68,8 @@ static void setCursorMode(_GLFWwindow* window, int newMode) | ||||
|         } | ||||
| 
 | ||||
|         _glfwPlatformSetCursorMode(window, newMode); | ||||
|     } | ||||
| 
 | ||||
|     window->cursorMode = newMode; | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user