Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2020-04-11 19:22:08 +08:00
parent 416f717834
commit 19279aa848
2 changed files with 7 additions and 5 deletions

View File

@ -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)) {
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);
}

View File

@ -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,