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/cocoawindowcontext.mm |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/core/contexts/cocoawindowcontext.mm b/src/core/contexts/cocoawindowcontext.mm
index a7e857e..d41d308 100644
--- a/src/core/contexts/cocoawindowcontext.mm
+++ b/src/core/contexts/cocoawindowcontext.mm
@@ -330,13 +330,9 @@
             nswindow.movableByWindowBackground = NO;
             nswindow.movable = NO; // This line causes the window in the wrong position when
                                    // become fullscreen.
-            //  For some unknown reason, we don't need the following hack in Qt versions below or
-            //  equal to 6.2.4.
-#if (QT_VERSION > QT_VERSION_CHECK(6, 2, 4))
-            [nswindow standardWindowButton:NSWindowCloseButton].hidden = (visible ? NO : YES);
-            [nswindow standardWindowButton:NSWindowMiniaturizeButton].hidden = (visible ? NO : YES);
-            [nswindow standardWindowButton:NSWindowZoomButton].hidden = (visible ? NO : YES);
-#endif
+            [nswindow standardWindowButton:NSWindowCloseButton].hidden = NO;
+            [nswindow standardWindowButton:NSWindowMiniaturizeButton].hidden = NO;
+            [nswindow standardWindowButton:NSWindowZoomButton].hidden = NO;
         }
 
         static void replaceImplementations() {
@@ -514,7 +510,7 @@
     static inline void releaseWindowProxy(const WId windowId) {
         if (auto proxy = g_proxyList->take(windowId)) {
             // TODO: Determine if the window is valid
-            
+
             // The window has been destroyed
             // proxy->setSystemTitleBarVisible(true);
             delete proxy;
@@ -637,8 +633,7 @@
             }
 
             case QEvent::MouseButtonDblClick: {
-                if (me->button() == Qt::LeftButton && inTitleBar &&
-                    !delegate->isHostSizeFixed(host)) {
+                if (me->button() == Qt::LeftButton && inTitleBar && !m_context->isHostSizeFixed()) {
                     Qt::WindowStates windowState = delegate->getWindowState(host);
                     if (!(windowState & Qt::WindowFullScreen)) {
                         if (windowState & Qt::WindowMaximized) {
@@ -699,7 +694,7 @@
             releaseWindowProxy(oldWinId);
         }
 
-        if (!m_windowHandle) {
+        if (!winId) {
             return;
         }
 

--
Gitblit v1.9.1