mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
fix wayland
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user