From bdc57c6ec9b08f74ca65a06b8496fbaa3268c5fd Mon Sep 17 00:00:00 2001
From: Dylan Liu <mentalflow@ourdocs.cn>
Date: 周六, 04 5月 2024 20:51:20 +0800
Subject: [PATCH] Fix macOS title bar buttons not displaying properly.

---
 src/widgets/widgetwindowagent_win.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/widgets/widgetwindowagent_win.cpp b/src/widgets/widgetwindowagent_win.cpp
index 13af840..706e865 100644
--- a/src/widgets/widgetwindowagent_win.cpp
+++ b/src/widgets/widgetwindowagent_win.cpp
@@ -84,7 +84,6 @@
         bool sharedEventFilter(QObject *obj, QEvent *event) override {
             Q_UNUSED(obj)
 
-            auto window = widget->windowHandle();
             switch (event->type()) {
                 case QEvent::Expose: {
                     // Qt will absolutely send a QExposeEvent or QResizeEvent to the QWindow when it
@@ -95,6 +94,7 @@
                     // Since a QExposeEvent will be sent immediately after the QResizeEvent, we can
                     // simply ignore it.
                     auto ee = static_cast<QExposeEvent *>(event);
+                    auto window = widget->windowHandle();
                     if (window->isExposed() && isNormalWindow() && !ee->region().isNull()) {
                         forwardEventToWindowAndDraw(window, event);
                         return true;

--
Gitblit v1.9.1