From 8a0b7831e988a347603e6abb4e8294010ab9b0e0 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周三, 27 12月 2023 06:26:26 +0800
Subject: [PATCH] Set project version

---
 src/widgets/widgetwindowagent_mac.cpp |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/widgets/widgetwindowagent_mac.cpp b/src/widgets/widgetwindowagent_mac.cpp
index 912b03f..31f45e6 100644
--- a/src/widgets/widgetwindowagent_mac.cpp
+++ b/src/widgets/widgetwindowagent_mac.cpp
@@ -19,7 +19,8 @@
             switch (event->type()) {
                 case QEvent::Move:
                 case QEvent::Resize: {
-                    ctx->setSystemButtonArea(widget->geometry());
+                    QRect rect(widget->mapTo(widget->window(), {}), widget->size());
+                    ctx->setSystemButtonArea(rect);
                     break;
                 }
 
@@ -34,11 +35,18 @@
         AbstractWindowContext *ctx;
     };
 
+    /*!
+        Returns the widget that acts as the system button area.
+    */
     QWidget *WidgetWindowAgent::systemButtonArea() const {
         Q_D(const WidgetWindowAgent);
         return d->systemButtonAreaWidget;
     }
 
+    /*!
+        Sets the widget that acts as the system button area. The system button will be centered in
+        its area, it is recommended to place the widget in a layout and set a fixed size policy.
+    */
     void WidgetWindowAgent::setSystemButtonArea(QWidget *widget) {
         Q_D(WidgetWindowAgent);
         auto ctx = d->context.get();

--
Gitblit v1.9.1