FIX for #92 return HTCAPTION only when mouse is pressed (#93)

This commit is contained in:
Julien 2021-12-18 01:20:50 +01:00 committed by GitHub
parent fb8f061091
commit 76c13cf9bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -572,8 +572,9 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
}
const bool isTop = localMouse.y() <= resizeBorderThickness;
*result = [clientRect, isTitleBar, &localMouse, resizeBorderThickness, windowWidth, isTop, window, max](){
const bool mousePressed = GetSystemMetrics(SM_SWAPBUTTON) ? GetAsyncKeyState(VK_RBUTTON) < 0 : GetAsyncKeyState(VK_LBUTTON) < 0;
if (max) {
if (isTitleBar) {
if (isTitleBar && mousePressed) {
return HTCAPTION;
}
return HTCLIENT;
@ -612,7 +613,7 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
if (isRight) {
return getBorderValue(HTRIGHT);
}
if (isTitleBar) {
if (isTitleBar && mousePressed) {
return HTCAPTION;
}
return HTCLIENT;