From 57c155148acfb1b4c806eee3d0f687ead699ac1f Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周二, 19 12月 2023 18:51:35 +0800 Subject: [PATCH] minor tweaks --- src/core/contexts/win32windowcontext.cpp | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/core/contexts/win32windowcontext.cpp b/src/core/contexts/win32windowcontext.cpp index 2a6ee76..0e84db1 100644 --- a/src/core/contexts/win32windowcontext.cpp +++ b/src/core/contexts/win32windowcontext.cpp @@ -117,7 +117,7 @@ private: DynamicApis() { #define DYNAMIC_API_RESOLVE(DLL, NAME) \ - p##NAME = reinterpret_cast<decltype(p##NAME)>(DLL.resolve(#NAME)) + p##NAME = reinterpret_cast<decltype(p##NAME)>(DLL.resolve(#NAME)) QSystemLibrary user32(QStringLiteral("user32")); DYNAMIC_API_RESOLVE(user32, GetDpiForWindow); @@ -332,7 +332,7 @@ static inline quint32 getDpiForWindow(HWND hwnd) { const DynamicApis &apis = DynamicApis::instance(); - if (apis.pGetDpiForWindow) { // Win10 + if (apis.pGetDpiForWindow) { // Win10 return apis.pGetDpiForWindow(hwnd); } else if (apis.pGetDpiForMonitor) { // Win8.1 HMONITOR monitor = ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); @@ -812,6 +812,11 @@ return; } + case RaiseWindowHook: { + // FIXME + return; + } + case ShowSystemMenuHook: { const auto &pos = *static_cast<const QPoint *>(data); auto hWnd = reinterpret_cast<HWND>(windowId); @@ -826,6 +831,23 @@ return; } + case WindowAttributeChangedHook: { + auto args = static_cast<void **>(data); + const auto &key = *static_cast<const QString *>(args[0]); + const auto &newVar = *static_cast<const QVariant *>(args[1]); + const auto &oldVar = *static_cast<const QVariant *>(args[2]); + + if (key == QStringLiteral("no-frame-shadow")) { + if (newVar.toBool()) { + // TODO: set off + } else { + // TODO: set on + } + } + + break; + } + case DefaultColorsHook: { auto &map = *static_cast<QMap<QString, QColor> *>(data); map.clear(); -- Gitblit v1.9.1