mirror of https://github.com/libsdl-org/SDL.git
win32: Pass through non-left mouse button presses when over draggable areas
Returning anything other an HTCLIENT result will cause windows to eat the button press, so ensure that non-left presses are passed through to the client over draggable areas.
This commit is contained in:
parent
84d35587ee
commit
dd0bdc2561
|
|
@ -2072,7 +2072,19 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
|
||||||
return ret; \
|
return ret; \
|
||||||
}
|
}
|
||||||
case SDL_HITTEST_DRAGGABLE:
|
case SDL_HITTEST_DRAGGABLE:
|
||||||
|
{
|
||||||
|
/* If the mouse button state is something other than none or left button down,
|
||||||
|
* return HTCLIENT, or Windows will eat the button press.
|
||||||
|
*/
|
||||||
|
SDL_MouseButtonFlags buttonState = SDL_GetGlobalMouseState(NULL, NULL);
|
||||||
|
if (buttonState && !(buttonState & SDL_BUTTON_LMASK)) {
|
||||||
|
// Set focus in case it was lost while previously moving over a draggable area.
|
||||||
|
SDL_SetMouseFocus(window);
|
||||||
|
return HTCLIENT;
|
||||||
|
}
|
||||||
|
|
||||||
POST_HIT_TEST(HTCAPTION);
|
POST_HIT_TEST(HTCAPTION);
|
||||||
|
}
|
||||||
case SDL_HITTEST_RESIZE_TOPLEFT:
|
case SDL_HITTEST_RESIZE_TOPLEFT:
|
||||||
POST_HIT_TEST(HTTOPLEFT);
|
POST_HIT_TEST(HTTOPLEFT);
|
||||||
case SDL_HITTEST_RESIZE_TOP:
|
case SDL_HITTEST_RESIZE_TOP:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue