From f79b4c3ef8fae15e1bce56e4443caa76a9e2b00a Mon Sep 17 00:00:00 2001
From: Zhao Yuhang <2546789017@qq.com>
Date: 摹曛, 10 4月 2025 11:26:28 +0800
Subject: [PATCH] update qmsetup

---
 src/core/shared/qwkwindowsextra_p.h |   57 +++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/src/core/shared/qwkwindowsextra_p.h b/src/core/shared/qwkwindowsextra_p.h
index 2147cc4..a173be9 100644
--- a/src/core/shared/qwkwindowsextra_p.h
+++ b/src/core/shared/qwkwindowsextra_p.h
@@ -14,14 +14,9 @@
 // version without notice, or may even be removed.
 //
 
-#include <shellscalingapi.h>
-#include <dwmapi.h>
-#include <timeapi.h>
-
 #include <QWKCore/qwindowkit_windows.h>
 
 #include <QtCore/QtMath>
-#include <QtCore/QPair>
 #include <QtGui/QGuiApplication>
 #include <QtGui/QStyleHints>
 #include <QtGui/QPalette>
@@ -29,6 +24,42 @@
 #include <QtCore/private/qsystemlibrary_p.h>
 
 // Don't include this header in any header files.
+
+typedef struct _MARGINS
+{
+    int cxLeftWidth;
+    int cxRightWidth;
+    int cyTopHeight;
+    int cyBottomHeight;
+} MARGINS, *PMARGINS;
+
+typedef enum MONITOR_DPI_TYPE {
+    MDT_EFFECTIVE_DPI = 0,
+    MDT_ANGULAR_DPI = 1,
+    MDT_RAW_DPI = 2,
+    MDT_DEFAULT = MDT_EFFECTIVE_DPI
+} MONITOR_DPI_TYPE;
+
+typedef struct _DWM_BLURBEHIND
+{
+    DWORD dwFlags;
+    BOOL fEnable;
+    HRGN hRgnBlur;
+    BOOL fTransitionOnMaximized;
+} DWM_BLURBEHIND, *PDWM_BLURBEHIND;
+
+extern "C" {
+    UINT    WINAPI GetDpiForWindow(HWND);
+    int     WINAPI GetSystemMetricsForDpi(int, UINT);
+    BOOL    WINAPI AdjustWindowRectExForDpi(LPRECT, DWORD, BOOL, DWORD, UINT);
+    HRESULT WINAPI GetDpiForMonitor(HMONITOR, MONITOR_DPI_TYPE, UINT *, UINT *);
+    HRESULT WINAPI DwmFlush();
+    HRESULT WINAPI DwmIsCompositionEnabled(BOOL*);
+    HRESULT WINAPI DwmGetWindowAttribute(HWND, DWORD, PVOID, DWORD);
+    HRESULT WINAPI DwmSetWindowAttribute(HWND, DWORD, LPCVOID, DWORD);
+    HRESULT WINAPI DwmExtendFrameIntoClientArea(HWND, const MARGINS*);
+    HRESULT WINAPI DwmEnableBlurBehindWindow(HWND, const DWM_BLURBEHIND*);
+} // extern "C"
 
 namespace QWK {
 
@@ -161,7 +192,7 @@
     namespace {
 
         struct DynamicApis {
-            static const DynamicApis &instance() {
+            static inline const DynamicApis &instance() {
                 static const DynamicApis inst;
                 return inst;
             }
@@ -170,7 +201,6 @@
 
             DYNAMIC_API_DECLARE(DwmFlush);
             DYNAMIC_API_DECLARE(DwmIsCompositionEnabled);
-            DYNAMIC_API_DECLARE(DwmGetCompositionTimingInfo);
             DYNAMIC_API_DECLARE(DwmGetWindowAttribute);
             DYNAMIC_API_DECLARE(DwmSetWindowAttribute);
             DYNAMIC_API_DECLARE(DwmExtendFrameIntoClientArea);
@@ -179,9 +209,6 @@
             DYNAMIC_API_DECLARE(GetSystemMetricsForDpi);
             DYNAMIC_API_DECLARE(AdjustWindowRectExForDpi);
             DYNAMIC_API_DECLARE(GetDpiForMonitor);
-            DYNAMIC_API_DECLARE(timeGetDevCaps);
-            DYNAMIC_API_DECLARE(timeBeginPeriod);
-            DYNAMIC_API_DECLARE(timeEndPeriod);
 
 #undef DYNAMIC_API_DECLARE
 
@@ -193,7 +220,7 @@
             SetPreferredAppModePtr pSetPreferredAppMode = nullptr;
 
         private:
-            DynamicApis() {
+            inline DynamicApis() {
 #define DYNAMIC_API_RESOLVE(DLL, NAME)                                                             \
     p##NAME = reinterpret_cast<decltype(p##NAME)>(DLL.resolve(#NAME))
 
@@ -209,16 +236,10 @@
                 QSystemLibrary dwmapi(QStringLiteral("dwmapi"));
                 DYNAMIC_API_RESOLVE(dwmapi, DwmFlush);
                 DYNAMIC_API_RESOLVE(dwmapi, DwmIsCompositionEnabled);
-                DYNAMIC_API_RESOLVE(dwmapi, DwmGetCompositionTimingInfo);
                 DYNAMIC_API_RESOLVE(dwmapi, DwmGetWindowAttribute);
                 DYNAMIC_API_RESOLVE(dwmapi, DwmSetWindowAttribute);
                 DYNAMIC_API_RESOLVE(dwmapi, DwmExtendFrameIntoClientArea);
                 DYNAMIC_API_RESOLVE(dwmapi, DwmEnableBlurBehindWindow);
-
-                QSystemLibrary winmm(QStringLiteral("winmm"));
-                DYNAMIC_API_RESOLVE(winmm, timeGetDevCaps);
-                DYNAMIC_API_RESOLVE(winmm, timeBeginPeriod);
-                DYNAMIC_API_RESOLVE(winmm, timeEndPeriod);
 
 #undef DYNAMIC_API_RESOLVE
 
@@ -235,7 +256,7 @@
 #undef UNDOC_API_RESOLVE
             }
 
-            ~DynamicApis() = default;
+            inline ~DynamicApis() = default;
 
             Q_DISABLE_COPY(DynamicApis)
         };

--
Gitblit v1.9.1