From 2db829884decaec5a4c469f0ddef39c9e13512d8 Mon Sep 17 00:00:00 2001 From: SineStriker <55847490+SineStriker@users.noreply.github.com> Date: Sat, 26 Aug 2023 17:59:17 +0800 Subject: [PATCH] Fix hover bug caused by system popup menu (#272) --- src/core/framelesshelper_win.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/framelesshelper_win.cpp b/src/core/framelesshelper_win.cpp index ec47ad7c..3889717d 100644 --- a/src/core/framelesshelper_win.cpp +++ b/src/core/framelesshelper_win.cpp @@ -1164,6 +1164,17 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me } break; } + case WM_INITMENU:{ + if (getHittedWindowPart(data.hitTestResult.second.value_or(HTNOWHERE)) == WindowPart::ChromeButton) { + emulateClientAreaMessage(WM_NCMOUSELEAVE); + + // Clear window part cache + auto &hitTestResult = muData.hitTestResult; + hitTestResult.first.reset(); + hitTestResult.second.reset(); + } + break; + } case WM_SIZE: { if (wParam == SIZE_MAXIMIZED || wParam == SIZE_MINIMIZED) { if (getHittedWindowPart(data.hitTestResult.second.value_or(HTNOWHERE)) == WindowPart::ChromeButton) {