From 25c75f59ce5ed4ba38b861102f4ba718bc3b1e5c Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Wed, 24 Dec 2025 13:32:43 +0800 Subject: [PATCH] fix: disable application theme saving MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Added DGuiApplicationHelper::DontSaveApplicationTheme attribute to prevent saving application theme settings 2. Added debug logging for dock color theme change events to help with debugging theme-related issues 3. This change ensures that the application doesn't persist theme changes across sessions, maintaining consistent theme behavior Log: Fixed theme persistence issue where application theme settings were being saved unintentionally Influence: 1. Test application theme behavior after restart to verify theme settings are not persisted 2. Verify that theme changes during runtime still work correctly 3. Check debug output for dock color theme change events 4. Test with different system themes to ensure consistent behavior 5. Verify no regression in other theme-related functionality fix: 禁用应用程序主题保存 1. 添加 DGuiApplicationHelper::DontSaveApplicationTheme 属性以防止保存应 用程序主题设置 2. 添加调试日志记录停靠栏颜色主题变更事件,便于调试主题相关问题 3. 此更改确保应用程序不会在会话间持久化主题更改,保持主题行为的一致性 Log: 修复了应用程序主题设置被意外保存的持久化问题 Influence: 1. 测试应用程序重启后的主题行为,验证主题设置未被持久化 2. 验证运行时主题更改仍能正常工作 3. 检查调试输出中的停靠栏颜色主题变更事件 4. 使用不同的系统主题测试以确保行为一致 5. 验证其他主题相关功能没有回归问题 --- src/loader/main.cpp | 1 + src/loader/widgetplugin.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/loader/main.cpp b/src/loader/main.cpp index 96bfb09c9..548a845a1 100644 --- a/src/loader/main.cpp +++ b/src/loader/main.cpp @@ -87,6 +87,7 @@ int main(int argc, char *argv[], char *envp[]) #endif DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::UseInactiveColorGroup, false); + DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::DontSaveApplicationTheme, true); init_setproctitle(argv, envp); QMap oldEnvs; oldEnvs["DSG_APP_ID"] = qgetenv("DSG_APP_ID"); diff --git a/src/loader/widgetplugin.cpp b/src/loader/widgetplugin.cpp index eacacbb8d..c6b9cd9d4 100644 --- a/src/loader/widgetplugin.cpp +++ b/src/loader/widgetplugin.cpp @@ -320,6 +320,7 @@ void WidgetPlugin::updateDockContainerState(PluginsItemInterface *itemInter, boo void WidgetPlugin::onDockColorThemeChanged(uint32_t type) { + qDebug() << "onDockColorThemeChanged:" << type; DGuiApplicationHelper::instance()->setPaletteType(static_cast(type)); }