From 564f33e8b29a6f73050f4da3f843b942aaf0d739 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周三, 08 5月 2024 19:36:16 +0800
Subject: [PATCH] Improve event filter handling

---
 src/core/contexts/cocoawindowcontext.mm |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/core/contexts/cocoawindowcontext.mm b/src/core/contexts/cocoawindowcontext.mm
index a7e857e..c26ccfa 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() {
@@ -699,7 +695,7 @@
             releaseWindowProxy(oldWinId);
         }
 
-        if (!m_windowHandle) {
+        if (!winId) {
             return;
         }
 

--
Gitblit v1.9.1