diff --git a/winnativeeventfilter.cpp b/winnativeeventfilter.cpp index 2bd3cf7..f74f001 100644 --- a/winnativeeventfilter.cpp +++ b/winnativeeventfilter.cpp @@ -1002,12 +1002,14 @@ qreal WinNativeEventFilter::getPreferedNumber(qreal num) { return result; } -void WinNativeEventFilter::updateWindow(HWND handle) { +void WinNativeEventFilter::updateWindow(HWND handle, bool triggerFrameChange) { initWin32Api(); if (handle && m_lpIsWindow(handle)) { - m_lpSetWindowPos(handle, nullptr, 0, 0, 0, 0, - SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOSIZE | - SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER); + if (triggerFrameChange) { + m_lpSetWindowPos(handle, nullptr, 0, 0, 0, 0, + SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOSIZE | + SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER); + } m_lpRedrawWindow(handle, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOCHILDREN); } diff --git a/winnativeeventfilter.h b/winnativeeventfilter.h index 8d7fd3a..f7bd13c 100644 --- a/winnativeeventfilter.h +++ b/winnativeeventfilter.h @@ -94,7 +94,7 @@ public: // window (if the pointer is null, return the system's standard value). static int titlebarHeight(HWND handle); - static void updateWindow(HWND handle); + static void updateWindow(HWND handle, bool triggerFrameChange = true); #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) bool nativeEventFilter(const QByteArray &eventType, void *message,