mirror of
https://github.com/storytold/winit.git
synced 2026-11-30 18:26:33 +01:00
- Windows 32bit GNU (stable, nightly): Rust 1.100 no longer ships host tools for i686-pc-windows-gnu, so the toolchain can't be installed (upstream dropped the job in rust-windowing/winit 6853ca5e). Only stable and nightly are excluded; 1.70.0 still covers the target. - web clippy (stable): code generated by #[wasm_bindgen] in newer wasm-bindgen releases uses const features stable since 1.77, which clippy::incompatible_msrv reports against the 1.70 MSRV. Allowed on the web module; the MSRV build locks an older wasm-bindgen. - Android, iOS, Redox: clipboard_native_probe was gated on all(unix, not(macos), feature = "wayland"), which those targets match. It uses the wayland_platform alias now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
83 lines
2.3 KiB
Rust
83 lines
2.3 KiB
Rust
use crate::monitor::{MonitorHandle as RootMonitorHandle, VideoModeHandle as RootVideoModeHandle};
|
|
use crate::window::Fullscreen as RootFullscreen;
|
|
|
|
#[cfg(android_platform)]
|
|
mod android;
|
|
#[cfg(ios_platform)]
|
|
mod ios;
|
|
#[cfg(any(x11_platform, wayland_platform))]
|
|
mod linux;
|
|
#[cfg(macos_platform)]
|
|
mod macos;
|
|
#[cfg(orbital_platform)]
|
|
mod orbital;
|
|
#[cfg(web_platform)]
|
|
// The code `#[wasm_bindgen]` generates in newer wasm-bindgen releases uses `const` features
|
|
// stable since Rust 1.77, which clippy reports against the 1.70 MSRV. The MSRV build locks an
|
|
// older wasm-bindgen.
|
|
#[allow(clippy::incompatible_msrv)]
|
|
mod web;
|
|
#[cfg(windows_platform)]
|
|
mod windows;
|
|
|
|
#[cfg(android_platform)]
|
|
use android as platform;
|
|
#[cfg(ios_platform)]
|
|
use ios as platform;
|
|
#[cfg(any(x11_platform, wayland_platform))]
|
|
use linux as platform;
|
|
#[cfg(macos_platform)]
|
|
use macos as platform;
|
|
#[cfg(orbital_platform)]
|
|
use orbital as platform;
|
|
#[cfg(web_platform)]
|
|
use web as platform;
|
|
#[cfg(windows_platform)]
|
|
use windows as platform;
|
|
|
|
pub use self::platform::*;
|
|
|
|
/// Helper for converting between platform-specific and generic
|
|
/// [`VideoModeHandle`]/[`MonitorHandle`]
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub(crate) enum Fullscreen {
|
|
Exclusive(VideoModeHandle),
|
|
Borderless(Option<MonitorHandle>),
|
|
}
|
|
|
|
impl From<RootFullscreen> for Fullscreen {
|
|
fn from(f: RootFullscreen) -> Self {
|
|
match f {
|
|
RootFullscreen::Exclusive(mode) => Self::Exclusive(mode.video_mode),
|
|
RootFullscreen::Borderless(Some(handle)) => Self::Borderless(Some(handle.inner)),
|
|
RootFullscreen::Borderless(None) => Self::Borderless(None),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl From<Fullscreen> for RootFullscreen {
|
|
fn from(f: Fullscreen) -> Self {
|
|
match f {
|
|
Fullscreen::Exclusive(video_mode) => {
|
|
Self::Exclusive(RootVideoModeHandle { video_mode })
|
|
},
|
|
Fullscreen::Borderless(Some(inner)) => {
|
|
Self::Borderless(Some(RootMonitorHandle { inner }))
|
|
},
|
|
Fullscreen::Borderless(None) => Self::Borderless(None),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[cfg(all(
|
|
not(ios_platform),
|
|
not(windows_platform),
|
|
not(macos_platform),
|
|
not(android_platform),
|
|
not(x11_platform),
|
|
not(wayland_platform),
|
|
not(web_platform),
|
|
not(orbital_platform),
|
|
))]
|
|
compile_error!("The platform you're compiling for is not supported by winit");
|