Broadcast potential theme changes on window creation

This commit is contained in:
Héctor Ramón Jiménez 2025-09-10 18:08:01 +02:00
parent a9091f9edd
commit 04f53b5f62
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -647,6 +647,20 @@ async fn run_instance<P>(
system_theme,
);
let window_theme = window
.raw
.theme()
.map(conversion::theme_mode)
.unwrap_or_default();
if system_theme != window_theme {
system_theme = window_theme;
runtime.broadcast(subscription::Event::SystemThemeChanged(
window_theme,
));
}
window.raw.set_theme(conversion::window_theme(
window.state.theme_mode(),
));