From 6f6f96909e7ded6ae3a4e59d9d4b62fa593abb23 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周日, 25 2月 2024 02:33:03 +0800
Subject: [PATCH] Fix quick initialization failure

---
 src/quick/quickwindowagent_win.cpp |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/quick/quickwindowagent_win.cpp b/src/quick/quickwindowagent_win.cpp
index aea554a..a265bbb 100644
--- a/src/quick/quickwindowagent_win.cpp
+++ b/src/quick/quickwindowagent_win.cpp
@@ -56,7 +56,8 @@
         anchors->setLeft(parentPri->left());
         anchors->setRight(parentPri->right());
 
-        setZ(std::numeric_limits<qreal>::max()); // Make sure our fake border always above everything in the window.
+        setZ(std::numeric_limits<qreal>::max()); // Make sure our fake border always above
+                                                 // everything in the window.
 
         context->installNativeEventFilter(this);
         context->installSharedEventFilter(this);
@@ -130,8 +131,14 @@
 
     bool BorderItem::sharedEventFilter(QObject *obj, QEvent *event) {
         Q_UNUSED(obj)
-        
+
         switch (event->type()) {
+            case QEvent::WinIdChange: {
+                if (auto winId = context->windowId()) {
+                    updateGeometry();
+                }
+                break;
+            }
             case QEvent::WindowStateChange: {
                 updateGeometry();
                 break;

--
Gitblit v1.9.1