On Unix, add option to pick backends
Add features 'x11' and 'wayland' to pick backends on Linux/BSD, with both enabled by default. Fixes #774.
This commit is contained in:
parent
5a6cfc314e
commit
c1ea0dde92
10 changed files with 323 additions and 200 deletions
|
|
@ -554,6 +554,7 @@ impl<T: 'static> EventLoop<T> {
|
|||
let instant_wakeup = {
|
||||
let window_target = match self.window_target.p {
|
||||
crate::platform_impl::EventLoopWindowTarget::Wayland(ref wt) => wt,
|
||||
#[cfg(feature = "x11")]
|
||||
_ => unreachable!(),
|
||||
};
|
||||
let dispatched = window_target
|
||||
|
|
@ -662,6 +663,7 @@ impl<T> EventLoop<T> {
|
|||
{
|
||||
let window_target = match self.window_target.p {
|
||||
crate::platform_impl::EventLoopWindowTarget::Wayland(ref wt) => wt,
|
||||
#[cfg(feature = "x11")]
|
||||
_ => unreachable!(),
|
||||
};
|
||||
window_target.store.lock().unwrap().for_each_redraw_trigger(
|
||||
|
|
@ -689,6 +691,7 @@ impl<T> EventLoop<T> {
|
|||
{
|
||||
let window_target = match self.window_target.p {
|
||||
crate::platform_impl::EventLoopWindowTarget::Wayland(ref wt) => wt,
|
||||
#[cfg(feature = "x11")]
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
|
|
@ -803,6 +806,7 @@ impl<T> EventLoop<T> {
|
|||
fn get_target<T>(target: &RootELW<T>) -> &EventLoopWindowTarget<T> {
|
||||
match target.p {
|
||||
crate::platform_impl::EventLoopWindowTarget::Wayland(ref wt) => wt,
|
||||
#[cfg(feature = "x11")]
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ impl Window {
|
|||
Some(Fullscreen::Borderless(RootMonitorHandle {
|
||||
inner: PlatformMonitorHandle::Wayland(ref monitor_id),
|
||||
})) => frame.set_fullscreen(Some(&monitor_id.proxy)),
|
||||
#[cfg(feature = "x11")]
|
||||
Some(Fullscreen::Borderless(_)) => unreachable!(),
|
||||
None => {
|
||||
if attributes.maximized {
|
||||
|
|
@ -354,6 +355,7 @@ impl Window {
|
|||
.unwrap()
|
||||
.set_fullscreen(Some(&monitor_id.proxy));
|
||||
}
|
||||
#[cfg(feature = "x11")]
|
||||
Some(Fullscreen::Borderless(_)) => unreachable!(),
|
||||
None => self.frame.lock().unwrap().unset_fullscreen(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue