From d0c3fa900a378ae1accd74cee88a9b0f03c13f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 2 May 2019 21:15:35 +0200 Subject: [PATCH] Win32: Fix non-client actions for disabled cursor Disabled cursor mode interfered with some non-client actions. --- src/win32_window.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/win32_window.c b/src/win32_window.c index 1392ed3c..b8d0dc3d 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -631,12 +631,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, // clicking a caption button if (HIWORD(lParam) == WM_LBUTTONDOWN) { - if (LOWORD(lParam) == HTCLOSE || - LOWORD(lParam) == HTMINBUTTON || - LOWORD(lParam) == HTMAXBUTTON) - { + if (LOWORD(lParam) != HTCLIENT) window->win32.frameAction = GLFW_TRUE; - } } break; @@ -943,6 +939,9 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_ENTERSIZEMOVE: case WM_ENTERMENULOOP: { + if (window->win32.frameAction) + break; + // HACK: Enable the cursor while the user is moving or // resizing the window or using the window menu if (window->cursorMode == GLFW_CURSOR_DISABLED) @@ -954,6 +953,9 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_EXITSIZEMOVE: case WM_EXITMENULOOP: { + if (window->win32.frameAction) + break; + // HACK: Disable the cursor once the user is done moving or // resizing the window or using the menu if (window->cursorMode == GLFW_CURSOR_DISABLED)