From c3fa2f6920438c814ebddb6ce8349c356c571521 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Fri, 16 Dec 2022 10:48:38 +0800 Subject: [PATCH] minor fixes of previous commit --- .../Core/framelesshelper_linux.h | 4 +- .../Core/framelesshelpercore_global.h | 56 +++++++++---------- src/widgets/framelesswidgetshelper.cpp | 7 +++ 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/include/FramelessHelper/Core/framelesshelper_linux.h b/include/FramelessHelper/Core/framelesshelper_linux.h index 720d2a5..7592f79 100644 --- a/include/FramelessHelper/Core/framelesshelper_linux.h +++ b/include/FramelessHelper/Core/framelesshelper_linux.h @@ -235,9 +235,9 @@ using gchararray = char *; using gpointer = void *; using gint64 = int64_t; using guint64 = uint64_t; -using gsize = unsigned long; +using gsize = unsigned int; -using GType = gsize; +using GType = unsigned long; using GValue = struct _GValue; using GObject = struct _GObject; using GClosure = struct _GClosure; diff --git a/include/FramelessHelper/Core/framelesshelpercore_global.h b/include/FramelessHelper/Core/framelesshelpercore_global.h index 3f2d0a5..0c52260 100644 --- a/include/FramelessHelper/Core/framelesshelpercore_global.h +++ b/include/FramelessHelper/Core/framelesshelpercore_global.h @@ -579,34 +579,34 @@ struct Dpi #ifdef Q_OS_WINDOWS [[maybe_unused]] inline constexpr const VersionNumber WindowsVersions[] = - { - { 5, 0, 2195}, // Windows 2000 - { 5, 1, 2600}, // Windows XP - { 5, 2, 3790}, // Windows XP x64 Edition or Windows Server 2003 - { 6, 0, 6000}, // Windows Vista - { 6, 0, 6001}, // Windows Vista with Service Pack 1 or Windows Server 2008 - { 6, 0, 6002}, // Windows Vista with Service Pack 2 - { 6, 1, 7600}, // Windows 7 or Windows Server 2008 R2 - { 6, 1, 7601}, // Windows 7 with Service Pack 1 or Windows Server 2008 R2 with Service Pack 1 - { 6, 2, 9200}, // Windows 8 or Windows Server 2012 - { 6, 3, 9200}, // Windows 8.1 or Windows Server 2012 R2 - { 6, 3, 9600}, // Windows 8.1 with Update 1 - {10, 0, 10240}, // Windows 10 Version 1507 (TH1) - {10, 0, 10586}, // Windows 10 Version 1511 (November Update) (TH2) - {10, 0, 14393}, // Windows 10 Version 1607 (Anniversary Update) (RS1) or Windows Server 2016 - {10, 0, 15063}, // Windows 10 Version 1703 (Creators Update) (RS2) - {10, 0, 16299}, // Windows 10 Version 1709 (Fall Creators Update) (RS3) - {10, 0, 17134}, // Windows 10 Version 1803 (April 2018 Update) (RS4) - {10, 0, 17763}, // Windows 10 Version 1809 (October 2018 Update) (RS5) or Windows Server 2019 - {10, 0, 18362}, // Windows 10 Version 1903 (May 2019 Update) (19H1) - {10, 0, 18363}, // Windows 10 Version 1909 (November 2019 Update) (19H2) - {10, 0, 19041}, // Windows 10 Version 2004 (May 2020 Update) (20H1) - {10, 0, 19042}, // Windows 10 Version 20H2 (October 2020 Update) (20H2) - {10, 0, 19043}, // Windows 10 Version 21H1 (May 2021 Update) (21H1) - {10, 0, 19044}, // Windows 10 Version 21H2 (November 2021 Update) (21H2) - {10, 0, 19045}, // Windows 10 Version 22H2 (October 2022 Update) (22H2) - {10, 0, 22000}, // Windows 11 Version 21H2 (21H2) - {10, 0, 22621} // Windows 11 Version 22H2 (October 2022 Update) (22H2) +{ + { 5, 0, 2195}, // Windows 2000 + { 5, 1, 2600}, // Windows XP + { 5, 2, 3790}, // Windows XP x64 Edition or Windows Server 2003 + { 6, 0, 6000}, // Windows Vista + { 6, 0, 6001}, // Windows Vista with Service Pack 1 or Windows Server 2008 + { 6, 0, 6002}, // Windows Vista with Service Pack 2 + { 6, 1, 7600}, // Windows 7 or Windows Server 2008 R2 + { 6, 1, 7601}, // Windows 7 with Service Pack 1 or Windows Server 2008 R2 with Service Pack 1 + { 6, 2, 9200}, // Windows 8 or Windows Server 2012 + { 6, 3, 9200}, // Windows 8.1 or Windows Server 2012 R2 + { 6, 3, 9600}, // Windows 8.1 with Update 1 + {10, 0, 10240}, // Windows 10 Version 1507 (TH1) + {10, 0, 10586}, // Windows 10 Version 1511 (November Update) (TH2) + {10, 0, 14393}, // Windows 10 Version 1607 (Anniversary Update) (RS1) or Windows Server 2016 + {10, 0, 15063}, // Windows 10 Version 1703 (Creators Update) (RS2) + {10, 0, 16299}, // Windows 10 Version 1709 (Fall Creators Update) (RS3) + {10, 0, 17134}, // Windows 10 Version 1803 (April 2018 Update) (RS4) + {10, 0, 17763}, // Windows 10 Version 1809 (October 2018 Update) (RS5) or Windows Server 2019 + {10, 0, 18362}, // Windows 10 Version 1903 (May 2019 Update) (19H1) + {10, 0, 18363}, // Windows 10 Version 1909 (November 2019 Update) (19H2) + {10, 0, 19041}, // Windows 10 Version 2004 (May 2020 Update) (20H1) + {10, 0, 19042}, // Windows 10 Version 20H2 (October 2020 Update) (20H2) + {10, 0, 19043}, // Windows 10 Version 21H1 (May 2021 Update) (21H1) + {10, 0, 19044}, // Windows 10 Version 21H2 (November 2021 Update) (21H2) + {10, 0, 19045}, // Windows 10 Version 22H2 (October 2022 Update) (22H2) + {10, 0, 22000}, // Windows 11 Version 21H2 (21H2) + {10, 0, 22621} // Windows 11 Version 22H2 (October 2022 Update) (22H2) }; #endif // Q_OS_WINDOWS diff --git a/src/widgets/framelesswidgetshelper.cpp b/src/widgets/framelesswidgetshelper.cpp index 5e6acc9..3dbf80d 100644 --- a/src/widgets/framelesswidgetshelper.cpp +++ b/src/widgets/framelesswidgetshelper.cpp @@ -422,6 +422,13 @@ void FramelessWidgetsHelperPrivate::attach() } m_window = window; + if (!window->testAttribute(Qt::WA_DontCreateNativeAncestors)) { + window->setAttribute(Qt::WA_DontCreateNativeAncestors); + } + if (!window->testAttribute(Qt::WA_NativeWindow)) { + window->setAttribute(Qt::WA_NativeWindow); + } + g_widgetsHelper()->mutex.lock(); WidgetsHelperData * const data = getWindowDataMutable(); if (!data || data->ready) {