From 60f2896e41ff081c581a2d2f9551a803bc288efa Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Fri, 18 Jul 2025 04:58:17 +0200 Subject: [PATCH] fix(appearance): reload system theme after resetting mode --- .../src/pages/desktop/appearance/mod.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cosmic-settings/src/pages/desktop/appearance/mod.rs b/cosmic-settings/src/pages/desktop/appearance/mod.rs index dd9bd8f..1ce5002 100644 --- a/cosmic-settings/src/pages/desktop/appearance/mod.rs +++ b/cosmic-settings/src/pages/desktop/appearance/mod.rs @@ -342,11 +342,15 @@ impl Page { let r = self.roundness; self.drawer.reset(&self.theme_manager); - #[cfg(feature = "wayland")] - tokio::task::spawn(async move { - Self::update_panel_radii(r); - Self::update_panel_spacing(Density::Standard); - }); + tasks.push(cosmic::task::future(async move { + #[cfg(feature = "wayland")] + { + Self::update_panel_radii(r); + Self::update_panel_spacing(Density::Standard); + } + + app::Message::SetTheme(cosmic::theme::system_preference()) + })); } #[cfg(feature = "xdg-portal")] @@ -521,11 +525,7 @@ impl Page { let mut tasks = cosmic::Task::batch(tasks); if let Some(stage) = theme_staged { - tasks = tasks - .chain(self.theme_manager.build_theme(stage)) - .chain(cosmic::task::future(async { - app::Message::SetTheme(cosmic::theme::system_preference()) - })) + tasks = tasks.chain(self.theme_manager.build_theme(stage)) } self.can_reset = if self.theme_manager.mode().is_dark {