From b49663c490141b75605eafa381f6c9e2c736147d Mon Sep 17 00:00:00 2001
From: SineStriker <trueful@163.com>
Date: 周三, 13 12月 2023 20:54:09 +0800
Subject: [PATCH] Fix mac

---
 src/core/contexts/win32windowcontext.cpp |   44 +++++---------------------------------------
 1 files changed, 5 insertions(+), 39 deletions(-)

diff --git a/src/core/contexts/win32windowcontext.cpp b/src/core/contexts/win32windowcontext.cpp
index 7dfd543..3f0ac32 100644
--- a/src/core/contexts/win32windowcontext.cpp
+++ b/src/core/contexts/win32windowcontext.cpp
@@ -84,7 +84,7 @@
     // ### FIXME: Tell the user to call in the documentation, instead of automatically
     // calling it directly.
     // ### FIXME FIXME FIXME
-    static struct QWK_Hook {
+    static const struct QWK_Hook {
         QWK_Hook() {
             qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
         }
@@ -1944,7 +1944,7 @@
 
             case WM_DWMCOLORIZATIONCOLORCHANGED: {
                 const QColor color = QColor::fromRgba(wParam);
-                const auto blendWithOpacity = *reinterpret_cast<LPBOOL>(lParam);
+                const auto blendedWithOpacity = *reinterpret_cast<LPBOOL>(lParam);
 
                 QEvent e(QEvent::UpdateLater);
                 dispatch(&e);
@@ -1955,47 +1955,13 @@
                 if (!wParam && lParam &&
                     std::wcscmp(reinterpret_cast<LPCWSTR>(lParam), L"ImmersiveColorSet") == 0) {
                     const QColor color = getAccentColor();
-                }
 
-                QEvent e(QEvent::UpdateLater);
-                dispatch(&e);
+                    QEvent e(QEvent::UpdateLater);
+                    dispatch(&e);
+                }
                 break;
             }
 
-            // case WM_SIZE: {
-            //     const bool max = wParam == SIZE_MAXIMIZED;
-            //     const bool min = wParam == SIZE_MINIMIZED;
-            //     const bool full = isFullScreen(hWnd);
-
-            //     Qt::WindowStates states{};
-            //     if (max) {
-            //         states |= Qt::WindowMaximized;
-            //     }
-            //     if (min) {
-            //         states |= Qt::WindowMinimized;
-            //     }
-            //     if (full) {
-            //         states |= Qt::WindowFullScreen;
-            //     }
-
-            //     // QTimer::singleShot(0, this, [this, states] {
-            //     QWindowStateChangeEvent e(states);
-            //     dispatch(&e);
-            //     // });
-            //     break;
-            // }
-
-            // case WM_ACTIVATE: {
-            //     const auto state = LOWORD(wParam);
-            //     const bool active = state == WA_ACTIVE || state == WA_CLICKACTIVE;
-            //     Q_UNUSED(state)
-
-            //     // QTimer::singleShot(0, this, [this, active] {
-            //     QEvent e(active ? QEvent::WindowActivate : QEvent::WindowDeactivate);
-            //     dispatch(&e);
-            //     // });
-            //     break;
-            // }
             default:
                 break;
         }

--
Gitblit v1.9.1