diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 90a4529b..4b7f02bd 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -647,6 +647,20 @@ async fn run_instance

( 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(), ));