diff --git a/src/core/framelesshelper_win.cpp b/src/core/framelesshelper_win.cpp index 0f5ea896..41cb9288 100644 --- a/src/core/framelesshelper_win.cpp +++ b/src/core/framelesshelper_win.cpp @@ -245,11 +245,13 @@ void FramelessHelperWin::addWindow(const QObject *window) #if 0 data->callbacks->setWindowFlags(data->callbacks->getWindowFlags() | Qt::FramelessWindowHint); #else +# if (QT_VERSION < QT_VERSION_CHECK(6, 5, 3)) // Qt maintains a frame margin internally, we need to update it accordingly // otherwise we'll get lots of warning messages when we change the window // geometry, it will also affect the final window geometry because QPA will // always take it into account when setting window size and position. std::ignore = Utils::updateInternalWindowFrameMargins(qWindow, true); +# endif #endif // Tell DWM our preferred frame margin. std::ignore = Utils::updateWindowFrameMargins(data->windowId, false); diff --git a/src/quick/framelessquickhelper.cpp b/src/quick/framelessquickhelper.cpp index 1649ccf4..77f03246 100644 --- a/src/quick/framelessquickhelper.cpp +++ b/src/quick/framelessquickhelper.cpp @@ -416,12 +416,12 @@ void FramelessQuickHelperPrivate::doRepaintAllChildren() if (!window) { return; } -#ifdef Q_OS_WINDOWS +#if (defined(Q_OS_WINDOWS) && (QT_VERSION < QT_VERSION_CHECK(6, 5, 3))) // Sync the internal window frame margins with the latest DPI, otherwise // we will get wrong window sizes after the DPI change. std::ignore = Utils::updateInternalWindowFrameMargins(window, true); -#endif // Q_OS_WINDOWS \ - // No need to repaint the window when it's hidden. +#endif // Q_OS_WINDOWS + // No need to repaint the window when it's hidden. if (!window->isVisible()) { return; } diff --git a/src/widgets/framelesswidgetshelper.cpp b/src/widgets/framelesswidgetshelper.cpp index 2fc44281..d6dd1b65 100644 --- a/src/widgets/framelesswidgetshelper.cpp +++ b/src/widgets/framelesswidgetshelper.cpp @@ -161,7 +161,7 @@ static inline void forceWidgetRepaint(QWidget *widget) if (!widget) { return; } -#ifdef Q_OS_WINDOWS +#if (defined(Q_OS_WINDOWS) && (QT_VERSION < QT_VERSION_CHECK(6, 5, 3))) // There's some additional things to do for top level windows on Windows. if (widget->isWindow()) { // Don't crash if the QWindow instance has not been created yet.