2
0
Эх сурвалжийг харах

Win32: Fix capture logic ignoring last mouse button

Camilla Löwy 8 жил өмнө
parent
commit
2fa90ae19f
1 өөрчлөгдсөн 4 нэмэгдсэн , 4 устгасан
  1. 4 4
      src/win32_window.c

+ 4 - 4
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)