Skip to content

Commit c22d3d7

Browse files
committed
fix: Emit ThemeChanged events
1 parent e87ab8d commit c22d3d7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/platform_impl/linux/event_loop.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,15 @@ impl<T: 'static> EventLoop<T> {
956956
WindowRequest::SetTheme(theme) => {
957957
if let Some(settings) = Settings::default() {
958958
settings.set_gtk_application_prefer_dark_theme(theme == Some(Theme::Dark));
959+
if let Err(e) = event_tx.send(Event::WindowEvent {
960+
window_id: RootWindowId(id),
961+
event: WindowEvent::ThemeChanged(theme.unwrap_or_default()),
962+
}) {
963+
log::warn!(
964+
"Failed to send window theme changed event to event channel: {}",
965+
e
966+
);
967+
}
959968
}
960969
}
961970
_ => unreachable!(),

0 commit comments

Comments
 (0)