From 3fbcf1aa8f91a804af50fad4e2b122f698259c94 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 摹曛, 09 5月 2024 23:45:28 +0800
Subject: [PATCH] Remove `isHostSizeFixed` in delegate

---
 src/core/contexts/win32windowcontext.cpp |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/core/contexts/win32windowcontext.cpp b/src/core/contexts/win32windowcontext.cpp
index a75efe7..84c80ef 100644
--- a/src/core/contexts/win32windowcontext.cpp
+++ b/src/core/contexts/win32windowcontext.cpp
@@ -625,6 +625,7 @@
         // Try hooked procedure and save result
         LRESULT result;
         if (ctx->windowProc(hWnd, message, wParam, lParam, &result)) {
+            // https://github.com/stdware/qwindowkit/issues/45
             // Forward the event to user-defined native event filters, there may be some messages
             // that need to be processed by the user.
             std::ignore =
@@ -704,7 +705,7 @@
                 const QPoint nativeGlobalPos = QHighDpi::toNativePixels(pos, m_windowHandle.data());
 #endif
                 std::ignore = showSystemMenu_sys(hWnd, qpoint2point(nativeGlobalPos), false,
-                                                 m_delegate->isHostSizeFixed(m_host));
+                                                 isHostSizeFixed());
                 return;
             }
 
@@ -1566,7 +1567,7 @@
                 QPoint qtScenePos = QHighDpi::fromNativeLocalPosition(point2qpoint(nativeLocalPos),
                                                                       m_windowHandle.data());
 
-                bool isFixedSize = m_delegate->isHostSizeFixed(m_host);
+                bool isFixedSize = isHostSizeFixed();
                 bool isTitleBar = isInTitleBarDraggableArea(qtScenePos);
                 bool dontOverrideCursor = false; // ### TODO
 
@@ -2205,8 +2206,8 @@
                 }
             }
 
-            bool res = showSystemMenu_sys(hWnd, nativeGlobalPos, broughtByKeyboard,
-                                          m_delegate->isHostSizeFixed(m_host));
+            bool res =
+                showSystemMenu_sys(hWnd, nativeGlobalPos, broughtByKeyboard, isHostSizeFixed());
 
             // Uninstall mouse hook and check if it's a double-click
             if (mouseHookedLocal) {

--
Gitblit v1.9.1