fix wayland

This commit is contained in:
amrbashir
2022-11-09 01:01:39 +02:00
parent 0fc16329ad
commit a85a0a91a7
2 changed files with 9 additions and 3 deletions

View File

@@ -621,9 +621,8 @@ impl Window {
}
#[inline]
pub fn set_theme(&self, _theme: Theme) {
#[cfg(feature = "sctk-adwaita")]
window.set_frame_config(theme.into());
pub fn set_theme(&self, theme: Theme) {
self.send_request(WindowRequest::Theme(theme));
}
#[inline]

View File

@@ -96,6 +96,9 @@ pub enum WindowRequest {
/// Window should be closed.
Close,
/// Change window theme.
Theme(Theme),
}
// The window update comming from the compositor.
@@ -537,6 +540,10 @@ pub fn handle_window_requests(winit_state: &mut WinitState) {
let event_sink = &mut winit_state.event_sink;
event_sink.push_window_event(WindowEvent::Destroyed, *window_id);
}
WindowRequest::Theme(_theme) => {
#[cfg(feature = "sctk-adwaita")]
window_handle.window.set_frame_config(_theme.into());
}
};
}
}