From b94e534906377129cc8e28c73d84f94c80a22d38 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Mon, 27 Apr 2020 10:49:54 +0800 Subject: [PATCH] Minor improvement. Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- winnativeeventfilter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/winnativeeventfilter.cpp b/winnativeeventfilter.cpp index c1f2928..49c91a8 100644 --- a/winnativeeventfilter.cpp +++ b/winnativeeventfilter.cpp @@ -763,6 +763,12 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType, ->lpCreateParams; m_lpSetWindowLongPtrW(msg->hwnd, GWLP_USERDATA, reinterpret_cast(userData)); + // Copied from MSDN without any modification: + // If you have changed certain window data using SetWindowLong, + // you must call SetWindowPos for the changes to take effect. + // Use the following combination for uFlags: SWP_NOMOVE | + // SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED. + updateWindow(msg->hwnd, true, false); } *result = m_lpDefWindowProcW(msg->hwnd, msg->message, msg->wParam, msg->lParam);