mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 13:20:06 -04:00
fix wayland
This commit is contained in:
@@ -621,9 +621,8 @@ impl Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_theme(&self, _theme: Theme) {
|
pub fn set_theme(&self, theme: Theme) {
|
||||||
#[cfg(feature = "sctk-adwaita")]
|
self.send_request(WindowRequest::Theme(theme));
|
||||||
window.set_frame_config(theme.into());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ pub enum WindowRequest {
|
|||||||
|
|
||||||
/// Window should be closed.
|
/// Window should be closed.
|
||||||
Close,
|
Close,
|
||||||
|
|
||||||
|
/// Change window theme.
|
||||||
|
Theme(Theme),
|
||||||
}
|
}
|
||||||
|
|
||||||
// The window update comming from the compositor.
|
// 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;
|
let event_sink = &mut winit_state.event_sink;
|
||||||
event_sink.push_window_event(WindowEvent::Destroyed, *window_id);
|
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