mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 13:20:06 -04:00
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:
@@ -426,6 +426,7 @@ impl<T: 'static> EventLoop<T> {
|
||||
pub(crate) fn get_xtarget<T>(target: &RootELW<T>) -> &EventLoopWindowTarget<T> {
|
||||
match target.p {
|
||||
super::EventLoopWindowTarget::X(ref target) => target,
|
||||
#[cfg(feature = "wayland")]
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
@@ -493,9 +494,21 @@ impl<'a> Deref for DeviceInfo<'a> {
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct WindowId(ffi::Window);
|
||||
|
||||
impl WindowId {
|
||||
pub unsafe fn dummy() -> Self {
|
||||
WindowId(0)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct DeviceId(c_int);
|
||||
|
||||
impl DeviceId {
|
||||
pub unsafe fn dummy() -> Self {
|
||||
DeviceId(0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Window(Arc<UnownedWindow>);
|
||||
|
||||
impl Deref for Window {
|
||||
|
||||
@@ -653,6 +653,7 @@ impl UnownedWindow {
|
||||
Fullscreen::Borderless(RootMonitorHandle {
|
||||
inner: PlatformMonitorHandle::X(ref monitor),
|
||||
}) => (None, monitor),
|
||||
#[cfg(feature = "wayland")]
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user