From ca6ba7d7aa547b4e0c8d86fb9e00f25374a181db Mon Sep 17 00:00:00 2001 From: Zhao Yuhang <2546789017@qq.com> Date: ćšć, 14 12æ 2023 21:26:31 +0800 Subject: [PATCH] fix qt5 build --- src/core/contexts/win32windowcontext.cpp | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/core/contexts/win32windowcontext.cpp b/src/core/contexts/win32windowcontext.cpp index 0f7b6f7..a661b3b 100644 --- a/src/core/contexts/win32windowcontext.cpp +++ b/src/core/contexts/win32windowcontext.cpp @@ -800,7 +800,12 @@ case ShowSystemMenuHook: { const auto &pos = *static_cast<const QPoint *>(data); auto hWnd = reinterpret_cast<HWND>(m_windowHandle->winId()); - showSystemMenu2(hWnd, qpoint2point(QHighDpi::toNativeGlobalPosition(pos, m_windowHandle)), false, +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + const QPoint nativeGlobalPos = QHighDpi::toNativeGlobalPosition(pos, m_windowHandle); +#else + const QPoint nativeGlobalPos = QHighDpi::toNativePixels(pos, m_windowHandle); +#endif + showSystemMenu2(hWnd, qpoint2point(nativeGlobalPos), false, m_delegate->isHostSizeFixed(m_host)); return; } -- Gitblit v1.9.1