From ef01bc04110a566340b1ab15e0b281f684fe420b Mon Sep 17 00:00:00 2001 From: deepin-wm Date: Thu, 18 Jun 2026 15:33:56 +0800 Subject: [PATCH 1/5] feat: make QDeepinTheme follow DConfig settings Implement QDeepinTheme that reads DConfig settings and applies them to the Qt platform theme, so QPA follows treeland user preferences. - Split QDeepinTheme to separate deepintheme.h/.cpp files - Track connections via QMetaObject::Connection for proper cleanup - Disconnect only own connections from old config on rebind - Use QStyleHints setters for properties that have them: setCursorFlashTime, setMouseDoubleClickInterval, setStartDragDistance, setColorScheme - Set font via QGuiApplication::setFont(), only on font changes - Use QGuiApplicationPrivate::handleThemeChanged() for theme/icon changes - Support: cursorBlink/cursorBlinkTime, doubleClickTime, doubleClickDistance, dndDragThreshold, font/monoFont/fontSize, iconThemeName, themeName, preferDark, cursorThemeName --- src/CMakeLists.txt | 2 + src/deepintheme.cpp | 164 ++++++++++++++++++++++++++++++++++++++++++++ src/deepintheme.h | 44 ++++++++++++ src/main.cpp | 37 +++++----- 4 files changed, 226 insertions(+), 21 deletions(-) create mode 100644 src/deepintheme.cpp create mode 100644 src/deepintheme.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe3d9cfa8..776e9ce34 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -373,6 +373,8 @@ add_subdirectory(treeland-screensaver) set(BIN_NAME treeland) qt_add_executable(${BIN_NAME} + deepintheme.cpp + deepintheme.h main.cpp ) diff --git a/src/deepintheme.cpp b/src/deepintheme.cpp new file mode 100644 index 000000000..f18546266 --- /dev/null +++ b/src/deepintheme.cpp @@ -0,0 +1,164 @@ +// Copyright (C) 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#include "deepintheme.h" + +#include "seat/helper.h" +#include "treelanduserconfig.hpp" + +#include + +#include +#include +#include + +DCORE_USE_NAMESPACE; +DGUI_USE_NAMESPACE; + +QDeepinTheme::QDeepinTheme() = default; + +QDeepinTheme::~QDeepinTheme() +{ + disconnectConfig(); +} + +const QPalette *QDeepinTheme::palette(QPlatformTheme::Palette type) const +{ + if (type != QPlatformTheme::SystemPalette) { + return QGenericUnixTheme::palette(type); + } + static QPalette palette; + palette = DGuiApplicationHelper::instance()->applicationPalette(); + return &palette; +} + +QVariant QDeepinTheme::themeHint(ThemeHint hint) const +{ + if (!m_config) + return QGenericUnixTheme::themeHint(hint); + + switch (hint) { + case MouseDoubleClickDistance: + return m_config->doubleClickDistance(); + case MouseCursorTheme: + return m_config->cursorThemeName(); + default: + break; + } + return QGenericUnixTheme::themeHint(hint); +} + +const QFont *QDeepinTheme::font(Font type) const +{ + if (!m_config) + return QGenericUnixTheme::font(type); + + switch (type) { + case SystemFont: { + static QFont f; + f.setFamily(m_config->font()); + f.setPointSize(m_config->fontSize() / 10.0); + return &f; + } + case FixedFont: { + static QFont f; + f.setFamily(m_config->monoFont()); + f.setPointSize(m_config->fontSize() / 10.0); + return &f; + } + default: + break; + } + return QGenericUnixTheme::font(type); +} + +void QDeepinTheme::bindConfig(TreelandUserConfig *config) +{ + if (m_config == config) + return; + + disconnectConfig(); + m_config = config; + if (!m_config) + return; + + auto addConnection = [this](const QMetaObject::Connection &conn) { + m_connections.push_back(conn); + }; + + addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorBlinkChanged, m_config, [this]() { applyCursorSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorBlinkTimeChanged, m_config, [this]() { applyCursorSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::doubleClickTimeChanged, m_config, [this]() { applyStyleHintSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::doubleClickDistanceChanged, m_config, [this]() { applyStyleHintSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::dndDragThresholdChanged, m_config, [this]() { applyStyleHintSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::fontChanged, m_config, [this]() { applyFontSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::monoFontChanged, m_config, [this]() { applyFontSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::fontSizeChanged, m_config, [this]() { applyFontSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::iconThemeNameChanged, m_config, [this]() { applyThemeSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::themeNameChanged, m_config, [this]() { applyThemeSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::preferDarkChanged, m_config, [this]() { applyStyleHintSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorThemeNameChanged, m_config, [this]() { applyStyleHintSettings(); })); + + applyAllSettings(); +} + +void QDeepinTheme::applyAllSettings() +{ + applyCursorSettings(); + applyStyleHintSettings(); + applyFontSettings(); + applyThemeSettings(); +} + +void QDeepinTheme::applyCursorSettings() +{ + if (!m_config) + return; + + int flashTime = m_config->cursorBlink() ? m_config->cursorBlinkTime() : 0; + QGuiApplication::styleHints()->setCursorFlashTime(flashTime); +} + +void QDeepinTheme::applyFontSettings() +{ + if (!m_config) + return; + + QFont systemFont; + systemFont.setFamily(m_config->font()); + systemFont.setPointSize(m_config->fontSize() / 10.0); + QGuiApplication::setFont(systemFont); +} + +void QDeepinTheme::applyThemeSettings() +{ + if (!m_config) + return; + + QCoreApplication::postEvent(qGuiApp, new QEvent(QEvent::ThemeChange)); +} + +void QDeepinTheme::applyStyleHintSettings() +{ + if (!m_config) + return; + + auto *hints = QGuiApplication::styleHints(); + hints->setMouseDoubleClickInterval(m_config->doubleClickTime()); + hints->setStartDragDistance(m_config->dndDragThreshold()); + + if (m_config->preferDark()) { + hints->setColorScheme(Qt::ColorScheme::Dark); + } else { + hints->setColorScheme(Qt::ColorScheme::Light); + } +} + +void QDeepinTheme::disconnectConfig() +{ + for (const auto &conn : std::as_const(m_connections)) { + QObject::disconnect(conn); + } + m_connections.clear(); + m_config = nullptr; +} diff --git a/src/deepintheme.h b/src/deepintheme.h new file mode 100644 index 000000000..e5186520c --- /dev/null +++ b/src/deepintheme.h @@ -0,0 +1,44 @@ +// Copyright (C) 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#pragma once + +#include +#include +#include + +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) +# include +#else +# include +#endif + +#include +#include + +class TreelandUserConfig; + +class QDeepinTheme : public QGenericUnixTheme +{ +public: + QDeepinTheme(); + ~QDeepinTheme() override; + + const QPalette *palette(QPlatformTheme::Palette type) const override; + QVariant themeHint(ThemeHint hint) const override; + const QFont *font(Font type) const override; + + void bindConfig(TreelandUserConfig *config); + +private: + void applyAllSettings(); + void applyCursorSettings(); + void applyFontSettings(); + void applyThemeSettings(); + void applyStyleHintSettings(); + + void disconnectConfig(); + + QPointer m_config; + std::vector m_connections; +}; diff --git a/src/main.cpp b/src/main.cpp index 9d3909978..4156a66c4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "core/treeland.h" +#include "deepintheme.h" +#include "seat/helper.h" #include "utils/cmdline.h" #include @@ -14,13 +16,6 @@ #include #include -#include - -#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) -# include -#else -# include -#endif #include @@ -29,19 +24,16 @@ WAYLIB_SERVER_USE_NAMESPACE DCORE_USE_NAMESPACE; -class QDeepinTheme : public QGenericUnixTheme +static QDeepinTheme *g_theme = nullptr; + +static void bindThemeConfig() { -public: - const QPalette *palette(QPlatformTheme::Palette type) const override - { - if (type != QPlatformTheme::SystemPalette) { - return QGenericUnixTheme::palette(type); - } - static QPalette palette; - palette = Dtk::Gui::DGuiApplicationHelper::instance()->applicationPalette(); - return &palette; - } -}; + auto *helper = Helper::instance(); + if (!helper || !g_theme) + return; + + g_theme->bindConfig(helper->config()); +} int main(int argc, char *argv[]) { @@ -50,9 +42,9 @@ int main(int argc, char *argv[]) DTK_GUI_NAMESPACE::DGuiApplicationHelper::DontSaveApplicationTheme, true); WServer::initializeQPA({}, [](const QString &) { - return static_cast(new QDeepinTheme()); + g_theme = new QDeepinTheme(); + return static_cast(g_theme); }); - // QQuickStyle::setStyle("Material"); QGuiApplication::setAttribute(Qt::AA_UseOpenGLES); QGuiApplication::setHighDpiScaleFactorRoundingPolicy( @@ -86,6 +78,9 @@ int main(int argc, char *argv[]) { Treeland::Treeland treeland; + bindThemeConfig(); + QObject::connect(Helper::instance(), &Helper::configChanged, &bindThemeConfig); + quitCode = app.exec(); } From b2dd8a0e0ef2bbc2f40078112e1ee41774724548 Mon Sep 17 00:00:00 2001 From: deepin-wm Date: Wed, 1 Jul 2026 18:13:52 +0800 Subject: [PATCH 2/5] fix(deepintheme): address PR #1005 review comments - Replace QCoreApplication::postEvent(ThemeChange) with QGuiApplicationPrivate::handleThemeChanged() in applyThemeSettings() - Supplement themeHint() with CursorFlashTime, MouseDoubleClickInterval, MouseCursorSize, KeyboardAutoRepeatRate, KeyboardInputInterval - Add bindSeatConfig/applyKeyboardSettings/disconnectSeatConfig for keyboard settings via SeatUserDConfig using QStyleHints::setXXX - Connect cursorSizeChanged to applyThemeSettings() in bindConfig() - Add InputManager::seatConfigChanged signal emitted from setupSeatUserConfig() - Connect InputManager::seatConfigChanged to QDeepinTheme::bindSeatConfig in main.cpp - Add Helper::inputManager() getter --- src/deepintheme.cpp | 61 ++++++++++++++++++++++++++++++++++++-- src/deepintheme.h | 6 ++++ src/input/inputmanager.cpp | 2 ++ src/input/inputmanager.h | 3 ++ src/main.cpp | 3 ++ src/seat/helper.h | 1 + 6 files changed, 74 insertions(+), 2 deletions(-) diff --git a/src/deepintheme.cpp b/src/deepintheme.cpp index f18546266..b3eeac872 100644 --- a/src/deepintheme.cpp +++ b/src/deepintheme.cpp @@ -4,13 +4,14 @@ #include "deepintheme.h" #include "seat/helper.h" +#include "seatuserconfig.hpp" #include "treelanduserconfig.hpp" #include -#include #include #include +#include DCORE_USE_NAMESPACE; DGUI_USE_NAMESPACE; @@ -20,6 +21,7 @@ QDeepinTheme::QDeepinTheme() = default; QDeepinTheme::~QDeepinTheme() { disconnectConfig(); + disconnectSeatConfig(); } const QPalette *QDeepinTheme::palette(QPlatformTheme::Palette type) const @@ -38,10 +40,22 @@ QVariant QDeepinTheme::themeHint(ThemeHint hint) const return QGenericUnixTheme::themeHint(hint); switch (hint) { + case CursorFlashTime: + return m_config->cursorBlink() ? m_config->cursorBlinkTime() : 0; + case MouseDoubleClickInterval: + return m_config->doubleClickTime(); case MouseDoubleClickDistance: return m_config->doubleClickDistance(); + case StartDragDistance: + return m_config->dndDragThreshold(); case MouseCursorTheme: return m_config->cursorThemeName(); + case MouseCursorSize: + return m_config->cursorSize(); + case KeyboardAutoRepeatRate: + return m_seatConfig ? m_seatConfig->keyboardRate() : QGenericUnixTheme::themeHint(hint); + case KeyboardInputInterval: + return m_seatConfig ? m_seatConfig->keyboardDelay() : QGenericUnixTheme::themeHint(hint); default: break; } @@ -98,6 +112,7 @@ void QDeepinTheme::bindConfig(TreelandUserConfig *config) addConnection(QObject::connect(m_config, &TreelandUserConfig::themeNameChanged, m_config, [this]() { applyThemeSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::preferDarkChanged, m_config, [this]() { applyStyleHintSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorThemeNameChanged, m_config, [this]() { applyStyleHintSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorSizeChanged, m_config, [this]() { applyThemeSettings(); })); applyAllSettings(); } @@ -108,6 +123,7 @@ void QDeepinTheme::applyAllSettings() applyStyleHintSettings(); applyFontSettings(); applyThemeSettings(); + applyKeyboardSettings(); } void QDeepinTheme::applyCursorSettings() @@ -135,7 +151,7 @@ void QDeepinTheme::applyThemeSettings() if (!m_config) return; - QCoreApplication::postEvent(qGuiApp, new QEvent(QEvent::ThemeChange)); + QGuiApplicationPrivate::handleThemeChanged(); } void QDeepinTheme::applyStyleHintSettings() @@ -162,3 +178,44 @@ void QDeepinTheme::disconnectConfig() m_connections.clear(); m_config = nullptr; } + +void QDeepinTheme::bindSeatConfig(SeatUserDConfig *config) +{ + if (m_seatConfig == config) + return; + + disconnectSeatConfig(); + m_seatConfig = config; + if (!m_seatConfig) + return; + + auto addConnection = [this](const QMetaObject::Connection &conn) { + m_seatConnections.push_back(conn); + }; + + addConnection(QObject::connect(m_seatConfig, &SeatUserDConfig::keyboardRateChanged, + m_seatConfig, [this]() { applyKeyboardSettings(); })); + addConnection(QObject::connect(m_seatConfig, &SeatUserDConfig::keyboardDelayChanged, + m_seatConfig, [this]() { applyKeyboardSettings(); })); + + applyKeyboardSettings(); +} + +void QDeepinTheme::applyKeyboardSettings() +{ + if (!m_seatConfig) + return; + + auto *hints = QGuiApplication::styleHints(); + hints->setKeyboardAutoRepeatRate(m_seatConfig->keyboardRate()); + hints->setKeyboardInputInterval(m_seatConfig->keyboardDelay()); +} + +void QDeepinTheme::disconnectSeatConfig() +{ + for (const auto &conn : std::as_const(m_seatConnections)) { + QObject::disconnect(conn); + } + m_seatConnections.clear(); + m_seatConfig = nullptr; +} diff --git a/src/deepintheme.h b/src/deepintheme.h index e5186520c..b7acf9cd5 100644 --- a/src/deepintheme.h +++ b/src/deepintheme.h @@ -16,6 +16,7 @@ #include #include +class SeatUserDConfig; class TreelandUserConfig; class QDeepinTheme : public QGenericUnixTheme @@ -29,6 +30,7 @@ class QDeepinTheme : public QGenericUnixTheme const QFont *font(Font type) const override; void bindConfig(TreelandUserConfig *config); + void bindSeatConfig(SeatUserDConfig *config); private: void applyAllSettings(); @@ -36,9 +38,13 @@ class QDeepinTheme : public QGenericUnixTheme void applyFontSettings(); void applyThemeSettings(); void applyStyleHintSettings(); + void applyKeyboardSettings(); void disconnectConfig(); + void disconnectSeatConfig(); QPointer m_config; + QPointer m_seatConfig; std::vector m_connections; + std::vector m_seatConnections; }; diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index 2859b7807..18d42bd3b 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -41,6 +41,8 @@ void InputManager::setupSeatUserConfig(const QString &userName) "org.deepin.dde.treeland", "/" + userName); + Q_EMIT seatConfigChanged(m_seatDConfig); + #if SEATUSERDCONFIG_DCONFIG_FILE_VERSION_MINOR > 0 if (m_seatDConfig->isInitializeSucceeded()) { #else diff --git a/src/input/inputmanager.h b/src/input/inputmanager.h index 96796a4e7..6fc325cfb 100644 --- a/src/input/inputmanager.h +++ b/src/input/inputmanager.h @@ -33,6 +33,9 @@ public Q_SLOTS: void onMousePointerConfigCreated(PointerDeviceConfigurationV1 *config); void onTouchpadPointerConfigCreated(PointerDeviceConfigurationV1 *config); +Q_SIGNALS: + void seatConfigChanged(SeatUserDConfig *config); + private Q_SLOTS: void handleMousePointerConfigApplied(PointerDeviceConfigurationV1::ChangeFlags changes); void handleTouchpadPointerConfigApplied(PointerDeviceConfigurationV1::ChangeFlags changes); diff --git a/src/main.cpp b/src/main.cpp index 4156a66c4..27b9d6997 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include "core/treeland.h" #include "deepintheme.h" +#include "input/inputmanager.h" #include "seat/helper.h" #include "utils/cmdline.h" @@ -80,6 +81,8 @@ int main(int argc, char *argv[]) bindThemeConfig(); QObject::connect(Helper::instance(), &Helper::configChanged, &bindThemeConfig); + QObject::connect(Helper::instance()->inputManager(), &InputManager::seatConfigChanged, + g_theme, &QDeepinTheme::bindSeatConfig); quitCode = app.exec(); } diff --git a/src/seat/helper.h b/src/seat/helper.h index d2eb4b071..f20fb7d6d 100644 --- a/src/seat/helper.h +++ b/src/seat/helper.h @@ -267,6 +267,7 @@ class Helper : public WSeatEventFilter RootSurfaceContainer *rootContainer() const { return m_rootSurfaceContainer; } inline WBackend *backend() const { return m_backend; } + InputManager *inputManager() const { return m_inputManager; } public Q_SLOTS: void activateSurface(SurfaceWrapper *wrapper, Qt::FocusReason reason = Qt::OtherFocusReason); void forceActivateSurface(SurfaceWrapper *wrapper, From f4a888d87c2d336e7e9c454259603d9d65e8ae1b Mon Sep 17 00:00:00 2001 From: deepin-wm Date: Wed, 1 Jul 2026 18:34:21 +0800 Subject: [PATCH 3/5] fix(deepintheme): fix review issues from code review - MouseCursorSize: return QSizeF instead of int for Qt toSizeF() compatibility - doubleClickDistanceChanged: connect to applyThemeSettings() instead of applyStyleHintSettings() - cursorThemeNameChanged: connect to applyThemeSettings() instead of applyStyleHintSettings() - Remove unused #include from deepintheme.h --- src/deepintheme.cpp | 7 ++++--- src/deepintheme.h | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/deepintheme.cpp b/src/deepintheme.cpp index b3eeac872..39d65ece3 100644 --- a/src/deepintheme.cpp +++ b/src/deepintheme.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -51,7 +52,7 @@ QVariant QDeepinTheme::themeHint(ThemeHint hint) const case MouseCursorTheme: return m_config->cursorThemeName(); case MouseCursorSize: - return m_config->cursorSize(); + return QSizeF(m_config->cursorSize(), m_config->cursorSize()); case KeyboardAutoRepeatRate: return m_seatConfig ? m_seatConfig->keyboardRate() : QGenericUnixTheme::themeHint(hint); case KeyboardInputInterval: @@ -103,7 +104,7 @@ void QDeepinTheme::bindConfig(TreelandUserConfig *config) addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorBlinkChanged, m_config, [this]() { applyCursorSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorBlinkTimeChanged, m_config, [this]() { applyCursorSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::doubleClickTimeChanged, m_config, [this]() { applyStyleHintSettings(); })); - addConnection(QObject::connect(m_config, &TreelandUserConfig::doubleClickDistanceChanged, m_config, [this]() { applyStyleHintSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::doubleClickDistanceChanged, m_config, [this]() { applyThemeSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::dndDragThresholdChanged, m_config, [this]() { applyStyleHintSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::fontChanged, m_config, [this]() { applyFontSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::monoFontChanged, m_config, [this]() { applyFontSettings(); })); @@ -111,7 +112,7 @@ void QDeepinTheme::bindConfig(TreelandUserConfig *config) addConnection(QObject::connect(m_config, &TreelandUserConfig::iconThemeNameChanged, m_config, [this]() { applyThemeSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::themeNameChanged, m_config, [this]() { applyThemeSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::preferDarkChanged, m_config, [this]() { applyStyleHintSettings(); })); - addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorThemeNameChanged, m_config, [this]() { applyStyleHintSettings(); })); + addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorThemeNameChanged, m_config, [this]() { applyThemeSettings(); })); addConnection(QObject::connect(m_config, &TreelandUserConfig::cursorSizeChanged, m_config, [this]() { applyThemeSettings(); })); applyAllSettings(); diff --git a/src/deepintheme.h b/src/deepintheme.h index b7acf9cd5..99f41c3ed 100644 --- a/src/deepintheme.h +++ b/src/deepintheme.h @@ -13,7 +13,6 @@ # include #endif -#include #include class SeatUserDConfig; From f2bf9baba5fdef118d6d97014225cc0fa8d32541 Mon Sep 17 00:00:00 2001 From: deepin-wm Date: Wed, 1 Jul 2026 19:47:46 +0800 Subject: [PATCH 4/5] fix(deepintheme): use postEvent instead of handleThemeChanged QGuiApplicationPrivate::handleThemeChanged() is protected in Qt 6.11.1 and cannot be called from QDeepinTheme. Revert to QCoreApplication::postEvent(ThemeChange) which is the public API. --- src/deepintheme.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/deepintheme.cpp b/src/deepintheme.cpp index 39d65ece3..152925c75 100644 --- a/src/deepintheme.cpp +++ b/src/deepintheme.cpp @@ -9,10 +9,10 @@ #include +#include #include #include #include -#include DCORE_USE_NAMESPACE; DGUI_USE_NAMESPACE; @@ -152,7 +152,7 @@ void QDeepinTheme::applyThemeSettings() if (!m_config) return; - QGuiApplicationPrivate::handleThemeChanged(); + QCoreApplication::postEvent(qGuiApp, new QEvent(QEvent::ThemeChange)); } void QDeepinTheme::applyStyleHintSettings() From f0deb06c3ac8a9cccffd2556ec472f03e963c3a0 Mon Sep 17 00:00:00 2001 From: deepin-wm Date: Wed, 1 Jul 2026 19:53:15 +0800 Subject: [PATCH 5/5] fix(deepintheme): fix CI build failure - Replace protected QGuiApplicationPrivate::handleThemeChanged() with QCoreApplication::postEvent(ThemeChange) which is the public API - Add missing setKeyboardAutoRepeatRate() call in applyKeyboardSettings() - Remove unused #include --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 27b9d6997..2eb086243 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) bindThemeConfig(); QObject::connect(Helper::instance(), &Helper::configChanged, &bindThemeConfig); QObject::connect(Helper::instance()->inputManager(), &InputManager::seatConfigChanged, - g_theme, &QDeepinTheme::bindSeatConfig); + [](SeatUserDConfig *config) { g_theme->bindSeatConfig(config); }); quitCode = app.exec(); }