Skip to content

Commit

Permalink
Win32: Fix non-client actions for disabled cursor
Browse files Browse the repository at this point in the history
Disabled cursor mode interfered with some non-client actions.
  • Loading branch information
elmindreda committed May 24, 2019
1 parent 267e06a commit d0c3fa9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/win32_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit d0c3fa9

Please sign in to comment.