From 29901fc2a97eedd3c914f807d1819c9ea7e69973 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周一, 25 12月 2023 17:53:34 +0800
Subject: [PATCH] Optimize Windows 10 border handling

---
 src/core/contexts/win32windowcontext_p.h |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/core/contexts/win32windowcontext_p.h b/src/core/contexts/win32windowcontext_p.h
index 8e25be7..baa0254 100644
--- a/src/core/contexts/win32windowcontext_p.h
+++ b/src/core/contexts/win32windowcontext_p.h
@@ -35,11 +35,10 @@
         QString key() const override;
         void virtual_hook(int id, void *data) override;
 
-        bool needBorderPainter() const;
-        int borderThickness() const;
-
     protected:
-        void winIdChanged(QWindow *oldWindow) override;
+        void winIdChanged() override;
+        bool windowAttributeChanged(const QString &key, const QVariant &attribute,
+                                    const QVariant &oldAttribute) override;
 
     public:
         bool windowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result);
@@ -60,6 +59,11 @@
         bool nonClientCalcSizeHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,
                                       LRESULT *result);
 
+    public:
+        bool needBorderPainter() const;
+
+        int borderThickness() const;
+
     protected:
         WId windowId = 0;
 
@@ -71,6 +75,8 @@
         bool mouseLeaveBlocked = false;
 
         bool centered = false;
+
+        bool hasExtraMargins = false;
     };
 
 }

--
Gitblit v1.9.1