win: tweak some enum values

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2023-02-03 11:18:08 +08:00
parent 2040e7c747
commit 3d37d87c81
48 changed files with 80 additions and 67 deletions

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include <framelesshelpercore_global.h> #include <FramelessHelper/Core/framelesshelpercore_global.h>
/* /*
* Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett. * Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett.

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
#include <QtCore/qabstractnativeeventfilter.h> #include <QtCore/qabstractnativeeventfilter.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -84,7 +84,7 @@
#include <shellapi.h> #include <shellapi.h>
#include <dwmapi.h> #include <dwmapi.h>
#include <framelesshelpercore_global.h> #include <FramelessHelper/Core/framelesshelpercore_global.h>
#ifndef WM_NCUAHDRAWCAPTION #ifndef WM_NCUAHDRAWCAPTION
# define WM_NCUAHDRAWCAPTION (0x00AE) # define WM_NCUAHDRAWCAPTION (0x00AE)
@ -267,7 +267,7 @@ using _PROCESS_DPI_AWARENESS = enum _PROCESS_DPI_AWARENESS
_PROCESS_DPI_UNAWARE = 0, _PROCESS_DPI_UNAWARE = 0,
_PROCESS_SYSTEM_DPI_AWARE = 1, _PROCESS_SYSTEM_DPI_AWARE = 1,
_PROCESS_PER_MONITOR_DPI_AWARE = 2, _PROCESS_PER_MONITOR_DPI_AWARE = 2,
_PROCESS_PER_MONITOR_DPI_AWARE_V2 = 3, _PROCESS_PER_MONITOR_V2_DPI_AWARE = 3,
_PROCESS_DPI_UNAWARE_GDISCALED = 4 _PROCESS_DPI_UNAWARE_GDISCALED = 4
}; };
@ -306,7 +306,7 @@ using _DPI_AWARENESS = enum _DPI_AWARENESS
_DPI_AWARENESS_UNAWARE = 0, _DPI_AWARENESS_UNAWARE = 0,
_DPI_AWARENESS_SYSTEM_AWARE = 1, _DPI_AWARENESS_SYSTEM_AWARE = 1,
_DPI_AWARENESS_PER_MONITOR_AWARE = 2, _DPI_AWARENESS_PER_MONITOR_AWARE = 2,
_DPI_AWARENESS_PER_MONITOR_AWARE_V2 = 3, _DPI_AWARENESS_PER_MONITOR_V2_AWARE = 3,
_DPI_AWARENESS_UNAWARE_GDISCALED = 4 _DPI_AWARENESS_UNAWARE_GDISCALED = 4
}; };
@ -380,16 +380,28 @@ using ACCENT_STATE = enum ACCENT_STATE
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
ACCENT_ENABLE_BLURBEHIND = 3, // Traditional DWM blur ACCENT_ENABLE_BLURBEHIND = 3, // Traditional DWM blur
ACCENT_ENABLE_ACRYLICBLURBEHIND = 4, // RS4 1803 ACCENT_ENABLE_ACRYLICBLURBEHIND = 4, // RS4 1803
ACCENT_USE_HOST_BACKDROP = 5, // RS5 1809 ACCENT_ENABLE_HOST_BACKDROP = 5, // RS5 1809
ACCENT_INVALID_STATE = 6 // Using this value will remove the window background ACCENT_INVALID_STATE = 6 // Using this value will remove the window background
}; };
using ACCENT_FLAG = enum ACCENT_FLAG
{
ACCENT_NONE = 0,
ACCENT_ENABLE_LUMINOSITY = 1 << 1,
ACCENT_ENABLE_BORDER_LEFT = 1 << 5,
ACCENT_ENABLE_BORDER_TOP = 1 << 6,
ACCENT_ENABLE_BORDER_RIGHT = 1 << 7,
ACCENT_ENABLE_BORDER_BOTTOM = 1 << 8,
ACCENT_ENABLE_BORDER = ACCENT_ENABLE_BORDER_LEFT | ACCENT_ENABLE_BORDER_TOP | ACCENT_ENABLE_BORDER_RIGHT | ACCENT_ENABLE_BORDER_BOTTOM,
ACCENT_ENABLE_ALL = ACCENT_ENABLE_BORDER
};
using ACCENT_POLICY = struct ACCENT_POLICY using ACCENT_POLICY = struct ACCENT_POLICY
{ {
ACCENT_STATE State; ACCENT_STATE AccentState;
DWORD Flags; ACCENT_FLAG AccentFlags;
DWORD GradientColor; // #AABBGGRR DWORD dwGradientColor; // #AABBGGRR
DWORD AnimationId; DWORD dwAnimationId;
}; };
using PACCENT_POLICY = ACCENT_POLICY *; using PACCENT_POLICY = ACCENT_POLICY *;

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
#include <QtGui/qbrush.h> #include <QtGui/qbrush.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
#include <QtCore/qvariant.h> #include <QtCore/qvariant.h>
#ifndef REGISTRYKEY_FORCE_QSETTINGS #ifndef REGISTRYKEY_FORCE_QSETTINGS

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,9 +24,9 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
# include "framelesshelper_linux.h" # include <FramelessHelper/Core/framelesshelper_linux.h>
#endif // Q_OS_LINUX #endif // Q_OS_LINUX
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelpercore_global.h" #include <FramelessHelper/Core/framelesshelpercore_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/qquickitem.h> #include <QtQuick/qquickitem.h>
#include <QtQuick/qquickwindow.h> #include <QtQuick/qquickwindow.h>

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QQmlEngine; class QQmlEngine;

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQml/qqmlparserstatus.h> #include <QtQml/qqmlparserstatus.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -26,7 +26,7 @@
#ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE #ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h> #include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -26,7 +26,7 @@
#ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE #ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/qquickwindow.h> #include <QtQuick/qquickwindow.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QQuickItem; class QQuickItem;

View File

@ -26,7 +26,7 @@
#ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE #ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/private/qquickwindowmodule_p.h> #include <QtQuick/private/qquickwindowmodule_p.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -26,7 +26,7 @@
#ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE #ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/qquickwindow.h> #include <QtQuick/qquickwindow.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtCore/qvariant.h> #include <QtCore/qvariant.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -26,7 +26,7 @@
#ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE #ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <QtQuickTemplates2/private/qquickbutton_p.h> #include <QtQuickTemplates2/private/qquickbutton_p.h>

View File

@ -26,10 +26,10 @@
#ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE #ifndef FRAMELESSHELPER_QUICK_NO_PRIVATE
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include "quickchromepalette.h" #include <FramelessHelper/Quick/quickchromepalette.h>
#include "quickstandardsystembutton_p.h" #include <FramelessHelper/Quick/private/quickstandardsystembutton_p.h>
#include <QtQuick/private/qquickrectangle_p.h> #include <QtQuick/private/qquickrectangle_p.h>
#include <QtQuickTemplates2/private/qquicklabel_p.h> #include <QtQuickTemplates2/private/qquicklabel_p.h>

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <FramelessHelper/Core/chromepalette.h> #include <FramelessHelper/Core/chromepalette.h>
#include <QtQml/qqmlparserstatus.h> #include <QtQml/qqmlparserstatus.h>

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/qquickpainteditem.h> #include <QtQuick/qquickpainteditem.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/qquickitem.h> #include <QtQuick/qquickitem.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperquick_global.h" #include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/qquickpainteditem.h> #include <QtQuick/qquickpainteditem.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qdialog.h> #include <QtWidgets/qdialog.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qmainwindow.h> #include <QtWidgets/qmainwindow.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qwidget.h> #include <QtWidgets/qwidget.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qwidget.h> #include <QtWidgets/qwidget.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtCore/qvariant.h> #include <QtCore/qvariant.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QEnterEvent; class QEnterEvent;

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtGui/qfont.h> #include <QtGui/qfont.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtGui/qscreen.h> #include <QtGui/qscreen.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -24,7 +24,7 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qabstractbutton.h> #include <QtWidgets/qabstractbutton.h>
FRAMELESSHELPER_BEGIN_NAMESPACE FRAMELESSHELPER_BEGIN_NAMESPACE

View File

@ -24,8 +24,8 @@
#pragma once #pragma once
#include "framelesshelperwidgets_global.h" #include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include "standardsystembutton.h" #include <FramelessHelper/Widgets/standardsystembutton.h>
#include <FramelessHelper/Core/chromepalette.h> #include <FramelessHelper/Core/chromepalette.h>
#include <QtWidgets/qwidget.h> #include <QtWidgets/qwidget.h>

View File

@ -1545,7 +1545,7 @@ void Utils::tryToEnableHighestDpiAwarenessLevel()
if (currentAwareness == DpiAwareness::PerMonitorVersion2) { if (currentAwareness == DpiAwareness::PerMonitorVersion2) {
return; return;
} }
if (SetProcessDpiAwareness2(_PROCESS_PER_MONITOR_DPI_AWARE_V2)) { if (SetProcessDpiAwareness2(_PROCESS_PER_MONITOR_V2_DPI_AWARE)) {
return; return;
} }
if (currentAwareness == DpiAwareness::PerMonitor) { if (currentAwareness == DpiAwareness::PerMonitor) {
@ -1762,7 +1762,8 @@ bool Utils::setBlurBehindWindowEnabled(const WId windowId, const BlurMode mode,
} else { } else {
ACCENT_POLICY policy; ACCENT_POLICY policy;
SecureZeroMemory(&policy, sizeof(policy)); SecureZeroMemory(&policy, sizeof(policy));
policy.State = ACCENT_DISABLED; policy.AccentState = ACCENT_DISABLED;
policy.AccentFlags = ACCENT_NONE;
WINDOWCOMPOSITIONATTRIBDATA wcad; WINDOWCOMPOSITIONATTRIBDATA wcad;
SecureZeroMemory(&wcad, sizeof(wcad)); SecureZeroMemory(&wcad, sizeof(wcad));
wcad.Attrib = WCA_ACCENT_POLICY; wcad.Attrib = WCA_ACCENT_POLICY;
@ -1831,9 +1832,8 @@ bool Utils::setBlurBehindWindowEnabled(const WId windowId, const BlurMode mode,
ACCENT_POLICY policy; ACCENT_POLICY policy;
SecureZeroMemory(&policy, sizeof(policy)); SecureZeroMemory(&policy, sizeof(policy));
if (blurMode == BlurMode::Windows_Acrylic) { if (blurMode == BlurMode::Windows_Acrylic) {
policy.State = ACCENT_ENABLE_ACRYLICBLURBEHIND; policy.AccentState = ACCENT_ENABLE_ACRYLICBLURBEHIND;
// Magic number, this member must be set to 2, otherwise will have no effect, don't know why. policy.AccentFlags = ACCENT_ENABLE_LUMINOSITY;
policy.Flags = 2;
const auto gradientColor = [&color]() -> QColor { const auto gradientColor = [&color]() -> QColor {
if (color.isValid()) { if (color.isValid()) {
return color; return color;
@ -1843,10 +1843,11 @@ bool Utils::setBlurBehindWindowEnabled(const WId windowId, const BlurMode mode,
return clr; return clr;
}(); }();
// This API expects the #AABBGGRR format. // This API expects the #AABBGGRR format.
policy.GradientColor = DWORD(qRgba(gradientColor.blue(), policy.dwGradientColor = DWORD(qRgba(gradientColor.blue(),
gradientColor.green(), gradientColor.red(), gradientColor.alpha())); gradientColor.green(), gradientColor.red(), gradientColor.alpha()));
} else if (blurMode == BlurMode::Windows_Aero) { } else if (blurMode == BlurMode::Windows_Aero) {
policy.State = ACCENT_ENABLE_BLURBEHIND; policy.AccentState = ACCENT_ENABLE_BLURBEHIND;
policy.AccentFlags = ACCENT_NONE;
} else { } else {
Q_UNREACHABLE_RETURN(false); Q_UNREACHABLE_RETURN(false);
} }
@ -2195,7 +2196,7 @@ DpiAwareness Utils::getDpiAwarenessForCurrentProcess(bool *highest)
case _DPI_AWARENESS_PER_MONITOR_AWARE: case _DPI_AWARENESS_PER_MONITOR_AWARE:
result = DpiAwareness::PerMonitor; result = DpiAwareness::PerMonitor;
break; break;
case _DPI_AWARENESS_PER_MONITOR_AWARE_V2: case _DPI_AWARENESS_PER_MONITOR_V2_AWARE:
result = DpiAwareness::PerMonitorVersion2; result = DpiAwareness::PerMonitorVersion2;
break; break;
case _DPI_AWARENESS_UNAWARE_GDISCALED: case _DPI_AWARENESS_UNAWARE_GDISCALED:
@ -2226,7 +2227,7 @@ DpiAwareness Utils::getDpiAwarenessForCurrentProcess(bool *highest)
case _PROCESS_PER_MONITOR_DPI_AWARE: case _PROCESS_PER_MONITOR_DPI_AWARE:
result = DpiAwareness::PerMonitor; result = DpiAwareness::PerMonitor;
break; break;
case _PROCESS_PER_MONITOR_DPI_AWARE_V2: case _PROCESS_PER_MONITOR_V2_DPI_AWARE:
result = DpiAwareness::PerMonitorVersion2; result = DpiAwareness::PerMonitorVersion2;
break; break;
case _PROCESS_DPI_UNAWARE_GDISCALED: case _PROCESS_DPI_UNAWARE_GDISCALED: