From 2fa90ae19f2eecd766932cb212aedbee345eda40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Sun, 9 Jul 2017 18:37:24 +0200 Subject: [PATCH] Win32: Fix capture logic ignoring last mouse button --- src/win32_window.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/win32_window.c b/src/win32_window.c index 6d691e19..93abd68d 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -628,24 +628,24 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, else action = GLFW_RELEASE; - for (i = 0; i < GLFW_MOUSE_BUTTON_LAST; i++) + for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++) { if (window->mouseButtons[i] == GLFW_PRESS) break; } - if (i == GLFW_MOUSE_BUTTON_LAST) + if (i > GLFW_MOUSE_BUTTON_LAST) SetCapture(hWnd); _glfwInputMouseClick(window, button, action, getKeyMods()); - for (i = 0; i < GLFW_MOUSE_BUTTON_LAST; i++) + for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++) { if (window->mouseButtons[i] == GLFW_PRESS) break; } - if (i == GLFW_MOUSE_BUTTON_LAST) + if (i > GLFW_MOUSE_BUTTON_LAST) ReleaseCapture(); if (uMsg == WM_XBUTTONDOWN || uMsg == WM_XBUTTONUP)