From 9c5d9f8614e3780478d5b0b3fb8deb6a97eb23c1 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 7 Oct 2013 15:30:57 +0200 Subject: [PATCH] Fixed clip rect being set for unfocused windows. --- README.md | 3 +++ src/win32_window.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f126d1e2..8579ef3e 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,8 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/). ## Changelog + - [Win32] Bugfix: The disabled cursor mode clip rectangle was updated for + unfocused windows - [Cocoa] Bugfix: The `GLFW_KEY_GRAVE_ACCENT` and `GLFW_KEY_WORLD_1` keys had been flipped - [Cocoa] Bugfix: The `GLFW_KEY_F13` key was reported as @@ -307,6 +309,7 @@ skills. - TTK-Bandit - Sergey Tikhomirov - Samuli Tuomola + - urraka - Jari Vetoniemi - Simon Voordouw - Torsten Walluhn diff --git a/src/win32_window.c b/src/win32_window.c index 139e661d..2b44ab16 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -654,8 +654,11 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_SIZE: { - if (window->cursorMode == GLFW_CURSOR_DISABLED) + if (window->cursorMode == GLFW_CURSOR_DISABLED && + _glfw.focusedWindow == window) + { updateClipRect(window); + } _glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam)); _glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam)); @@ -664,8 +667,11 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_MOVE: { - if (window->cursorMode == GLFW_CURSOR_DISABLED) + if (window->cursorMode == GLFW_CURSOR_DISABLED && + _glfw.focusedWindow == window) + { updateClipRect(window); + } _glfwInputWindowPos(window, LOWORD(lParam), HIWORD(lParam)); return 0;