From 61f65f23ffee628344fb9ebb0f71e1d7c480976b Mon Sep 17 00:00:00 2001 From: Zhao Yuhang <2546789017@qq.com> Date: 周日, 17 12月 2023 19:29:47 +0800 Subject: [PATCH] improve readability --- src/core/contexts/win32windowcontext.cpp | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/core/contexts/win32windowcontext.cpp b/src/core/contexts/win32windowcontext.cpp index 3aeb2cb..864f552 100644 --- a/src/core/contexts/win32windowcontext.cpp +++ b/src/core/contexts/win32windowcontext.cpp @@ -79,16 +79,6 @@ // Original Qt window proc function static WNDPROC g_qtWindowProc = nullptr; - // ### FIXME FIXME FIXME - // ### FIXME: Tell the user to call in the documentation, instead of automatically - // calling it directly. - // ### FIXME FIXME FIXME - static const struct QWK_Hook { - QWK_Hook() { - qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); - } - } g_hook{}; - struct DynamicApis { static const DynamicApis &instance() { static const DynamicApis inst{}; @@ -1558,8 +1548,9 @@ // the client area as a whole will shift to the left, which looks very abnormal if // we don't repaint it. This exception disappears if we add SWP_NOCOPYBITS flag. // But I don't know what caused the problem, or why this would solve it. + static constexpr const auto kBadWindowPosFlag = SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED; const auto windowPos = reinterpret_cast<LPWINDOWPOS>(lParam); - if ((windowPos->flags & SWP_FRAMECHANGED) && (windowPos->flags & SWP_NOSIZE)) { + if (windowPos->flags == kBadWindowPosFlag) { windowPos->flags |= SWP_NOCOPYBITS; } break; -- Gitblit v1.9.1