From d3d7430ec9afb94abaf78fa2c9edd9d9f946881c Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周一, 18 12月 2023 01:29:07 +0800
Subject: [PATCH] Add QtContext WinIdChange workaround

---
 src/core/contexts/qtwindowcontext.cpp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/core/contexts/qtwindowcontext.cpp b/src/core/contexts/qtwindowcontext.cpp
index 45aed07..35fc2d1 100644
--- a/src/core/contexts/qtwindowcontext.cpp
+++ b/src/core/contexts/qtwindowcontext.cpp
@@ -253,10 +253,11 @@
         AbstractWindowContext::virtual_hook(id, data);
     }
 
-    bool QtWindowContext::winIdChanged() {
-        m_delegate->setWindowFlags(m_host, Qt::FramelessWindowHint);
-        std::ignore = new QtWindowEventFilter(this, this);
-        return true;
+    void QtWindowContext::winIdChanged(QWindow *oldWindow) {
+        Q_UNUSED(oldWindow)
+        m_delegate->setWindowFlags(m_host,
+                                   m_delegate->getWindowFlags(m_host) | Qt::FramelessWindowHint);
+        qtWindowEventFilter = std::make_unique<QtWindowEventFilter>(this);
     }
 
-}
\ No newline at end of file
+}

--
Gitblit v1.9.1