chore: always pull raw-window-handle
Winit is not useful without it and we don't provide older versions anymore.
This commit is contained in:
parent
edfb4b03f4
commit
b2896d7408
23 changed files with 8 additions and 117 deletions
10
Cargo.toml
10
Cargo.toml
|
|
@ -25,7 +25,6 @@ version = "0.30.5"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = [
|
features = [
|
||||||
"rwh_06",
|
|
||||||
"serde",
|
"serde",
|
||||||
"mint",
|
"mint",
|
||||||
# Enabled to get docs to compile
|
# Enabled to get docs to compile
|
||||||
|
|
@ -55,9 +54,8 @@ targets = [
|
||||||
[features]
|
[features]
|
||||||
android-game-activity = ["android-activity/game-activity"]
|
android-game-activity = ["android-activity/game-activity"]
|
||||||
android-native-activity = ["android-activity/native-activity"]
|
android-native-activity = ["android-activity/native-activity"]
|
||||||
default = ["rwh_06", "x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"]
|
default = ["x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"]
|
||||||
mint = ["dpi/mint"]
|
mint = ["dpi/mint"]
|
||||||
rwh_06 = ["dep:rwh_06", "ndk/rwh_06"]
|
|
||||||
serde = ["dep:serde", "cursor-icon/serde", "smol_str/serde", "dpi/serde", "bitflags/serde"]
|
serde = ["dep:serde", "cursor-icon/serde", "smol_str/serde", "dpi/serde", "bitflags/serde"]
|
||||||
wayland = [
|
wayland = [
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
|
|
@ -81,7 +79,7 @@ cfg_aliases = "0.2.1"
|
||||||
bitflags = "2"
|
bitflags = "2"
|
||||||
cursor-icon = "1.1.0"
|
cursor-icon = "1.1.0"
|
||||||
dpi = { version = "0.1.1", path = "dpi" }
|
dpi = { version = "0.1.1", path = "dpi" }
|
||||||
rwh_06 = { package = "raw-window-handle", version = "0.6", features = ["std"], optional = true }
|
rwh_06 = { package = "raw-window-handle", version = "0.6", features = ["std"] }
|
||||||
serde = { workspace = true, optional = true }
|
serde = { workspace = true, optional = true }
|
||||||
smol_str = "0.2.0"
|
smol_str = "0.2.0"
|
||||||
tracing = { version = "0.1.40", default-features = false }
|
tracing = { version = "0.1.40", default-features = false }
|
||||||
|
|
@ -102,7 +100,7 @@ softbuffer = { version = "0.4.6", default-features = false, features = [
|
||||||
# Android
|
# Android
|
||||||
[target.'cfg(target_os = "android")'.dependencies]
|
[target.'cfg(target_os = "android")'.dependencies]
|
||||||
android-activity = "0.6.0"
|
android-activity = "0.6.0"
|
||||||
ndk = { version = "0.9.0", default-features = false }
|
ndk = { version = "0.9.0", features = ["rwh_06"], default-features = false }
|
||||||
|
|
||||||
# AppKit or UIKit
|
# AppKit or UIKit
|
||||||
[target.'cfg(target_vendor = "apple")'.dependencies]
|
[target.'cfg(target_vendor = "apple")'.dependencies]
|
||||||
|
|
@ -345,11 +343,9 @@ wasm-bindgen-test = "0.3"
|
||||||
[[example]]
|
[[example]]
|
||||||
doc-scrape-examples = true
|
doc-scrape-examples = true
|
||||||
name = "window"
|
name = "window"
|
||||||
required-features = ["rwh_06"]
|
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "child_window"
|
name = "child_window"
|
||||||
required-features = ["rwh_06"]
|
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["dpi"]
|
members = ["dpi"]
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
pub use platform::cleanup_window;
|
pub use platform::cleanup_window;
|
||||||
pub use platform::fill_window;
|
pub use platform::fill_window;
|
||||||
|
|
||||||
#[cfg(all(feature = "rwh_06", not(any(target_os = "android", target_os = "ios"))))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
mod platform {
|
mod platform {
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
@ -106,7 +106,7 @@ mod platform {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(all(feature = "rwh_06", not(any(target_os = "android", target_os = "ios")))))]
|
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||||
mod platform {
|
mod platform {
|
||||||
pub fn fill_window(_window: &dyn winit::window::Window) {
|
pub fn fill_window(_window: &dyn winit::window::Window) {
|
||||||
// No-op on mobile platforms.
|
// No-op on mobile platforms.
|
||||||
|
|
|
||||||
|
|
@ -273,7 +273,6 @@ impl EventLoop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for EventLoop {
|
impl rwh_06::HasDisplayHandle for EventLoop {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
rwh_06::HasDisplayHandle::display_handle(self.event_loop.window_target().rwh_06_handle())
|
rwh_06::HasDisplayHandle::display_handle(self.event_loop.window_target().rwh_06_handle())
|
||||||
|
|
@ -407,11 +406,9 @@ pub trait ActiveEventLoop: AsAny {
|
||||||
fn owned_display_handle(&self) -> OwnedDisplayHandle;
|
fn owned_display_handle(&self) -> OwnedDisplayHandle;
|
||||||
|
|
||||||
/// Get the raw-window-handle handle.
|
/// Get the raw-window-handle handle.
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle;
|
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for dyn ActiveEventLoop + '_ {
|
impl rwh_06::HasDisplayHandle for dyn ActiveEventLoop + '_ {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
self.rwh_06_handle().display_handle()
|
self.rwh_06_handle().display_handle()
|
||||||
|
|
@ -432,7 +429,7 @@ impl rwh_06::HasDisplayHandle for dyn ActiveEventLoop + '_ {
|
||||||
/// - A reference-counted pointer to the underlying type.
|
/// - A reference-counted pointer to the underlying type.
|
||||||
#[derive(Clone, PartialEq, Eq)]
|
#[derive(Clone, PartialEq, Eq)]
|
||||||
pub struct OwnedDisplayHandle {
|
pub struct OwnedDisplayHandle {
|
||||||
#[cfg_attr(not(feature = "rwh_06"), allow(dead_code))]
|
#[allow(dead_code)]
|
||||||
pub(crate) platform: platform_impl::OwnedDisplayHandle,
|
pub(crate) platform: platform_impl::OwnedDisplayHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -443,7 +440,6 @@ impl fmt::Debug for OwnedDisplayHandle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for OwnedDisplayHandle {
|
impl rwh_06::HasDisplayHandle for OwnedDisplayHandle {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,6 @@
|
||||||
// Re-export DPI types so that users don't have to put it in Cargo.toml.
|
// Re-export DPI types so that users don't have to put it in Cargo.toml.
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use dpi;
|
pub use dpi;
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
pub use rwh_06 as raw_window_handle;
|
pub use rwh_06 as raw_window_handle;
|
||||||
|
|
||||||
pub mod application;
|
pub mod application;
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@ impl<W: Window> Deref for AnyThread<W> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl<W: Window> rwh_06::HasWindowHandle for AnyThread<W> {
|
impl<W: Window> rwh_06::HasWindowHandle for AnyThread<W> {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
// SAFETY: The top level user has asserted this is only used safely.
|
// SAFETY: The top level user has asserted this is only used safely.
|
||||||
|
|
@ -337,7 +336,6 @@ pub trait WindowExtWindows {
|
||||||
/// });
|
/// });
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
unsafe fn window_handle_any_thread(
|
unsafe fn window_handle_any_thread(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError>;
|
) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError>;
|
||||||
|
|
@ -401,7 +399,6 @@ impl WindowExtWindows for dyn Window + '_ {
|
||||||
window.set_corner_preference(preference)
|
window.set_corner_preference(preference)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
unsafe fn window_handle_any_thread(
|
unsafe fn window_handle_any_thread(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
|
|
@ -435,16 +432,8 @@ pub trait WindowBorrowExtWindows: Borrow<dyn Window> + Sized {
|
||||||
/// Win32 APIs.
|
/// Win32 APIs.
|
||||||
///
|
///
|
||||||
/// [`Window`]: crate::window::Window
|
/// [`Window`]: crate::window::Window
|
||||||
#[cfg_attr(
|
/// [`HasWindowHandle`]: rwh_06::HasWindowHandle
|
||||||
feature = "rwh_06",
|
/// [`window_handle_any_thread`]: WindowExtWindows::window_handle_any_thread
|
||||||
doc = "[`HasWindowHandle`]: rwh_06::HasWindowHandle",
|
|
||||||
doc = "[`window_handle_any_thread`]: WindowExtWindows::window_handle_any_thread"
|
|
||||||
)]
|
|
||||||
#[cfg_attr(
|
|
||||||
not(feature = "rwh_06"),
|
|
||||||
doc = "[`HasWindowHandle`]: #only-available-with-rwh_06",
|
|
||||||
doc = "[`window_handle_any_thread`]: #only-available-with-rwh_06"
|
|
||||||
)]
|
|
||||||
unsafe fn any_thread(self) -> AnyThread<Self>
|
unsafe fn any_thread(self) -> AnyThread<Self>
|
||||||
where
|
where
|
||||||
Self: Window,
|
Self: Window,
|
||||||
|
|
|
||||||
|
|
@ -718,13 +718,11 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
||||||
RootOwnedDisplayHandle { platform: OwnedDisplayHandle }
|
RootOwnedDisplayHandle { platform: OwnedDisplayHandle }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = rwh_06::AndroidDisplayHandle::new();
|
let raw = rwh_06::AndroidDisplayHandle::new();
|
||||||
|
|
@ -736,7 +734,6 @@ impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
pub(crate) struct OwnedDisplayHandle;
|
pub(crate) struct OwnedDisplayHandle;
|
||||||
|
|
||||||
impl OwnedDisplayHandle {
|
impl OwnedDisplayHandle {
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
@ -771,7 +768,6 @@ impl Window {
|
||||||
self.app.content_rect()
|
self.app.content_rect()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
// Allow the usage of HasRawWindowHandle inside this function
|
// Allow the usage of HasRawWindowHandle inside this function
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
fn raw_window_handle_rwh_06(&self) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
fn raw_window_handle_rwh_06(&self) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
||||||
|
|
@ -789,13 +785,11 @@ impl Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn raw_display_handle_rwh_06(&self) -> Result<rwh_06::RawDisplayHandle, rwh_06::HandleError> {
|
fn raw_display_handle_rwh_06(&self) -> Result<rwh_06::RawDisplayHandle, rwh_06::HandleError> {
|
||||||
Ok(rwh_06::RawDisplayHandle::Android(rwh_06::AndroidDisplayHandle::new()))
|
Ok(rwh_06::RawDisplayHandle::Android(rwh_06::AndroidDisplayHandle::new()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for Window {
|
impl rwh_06::HasDisplayHandle for Window {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_display_handle_rwh_06()?;
|
let raw = self.raw_display_handle_rwh_06()?;
|
||||||
|
|
@ -803,7 +797,6 @@ impl rwh_06::HasDisplayHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasWindowHandle for Window {
|
impl rwh_06::HasWindowHandle for Window {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_window_handle_rwh_06()?;
|
let raw = self.raw_window_handle_rwh_06()?;
|
||||||
|
|
@ -981,12 +974,10 @@ impl CoreWindow for Window {
|
||||||
|
|
||||||
fn reset_dead_keys(&self) {}
|
fn reset_dead_keys(&self) {}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -155,13 +155,11 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
||||||
RootOwnedDisplayHandle { platform: OwnedDisplayHandle }
|
RootOwnedDisplayHandle { platform: OwnedDisplayHandle }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = rwh_06::RawDisplayHandle::AppKit(rwh_06::AppKitDisplayHandle::new());
|
let raw = rwh_06::RawDisplayHandle::AppKit(rwh_06::AppKitDisplayHandle::new());
|
||||||
|
|
@ -395,7 +393,6 @@ impl EventLoop {
|
||||||
pub(crate) struct OwnedDisplayHandle;
|
pub(crate) struct OwnedDisplayHandle;
|
||||||
|
|
||||||
impl OwnedDisplayHandle {
|
impl OwnedDisplayHandle {
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ impl Window {
|
||||||
self.delegate.get_on_main(|delegate| f(delegate))
|
self.delegate.get_on_main(|delegate| f(delegate))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) fn raw_window_handle_rwh_06(
|
pub(crate) fn raw_window_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
@ -54,7 +53,6 @@ impl Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) fn raw_display_handle_rwh_06(
|
pub(crate) fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
@ -74,7 +72,6 @@ impl Drop for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for Window {
|
impl rwh_06::HasDisplayHandle for Window {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_display_handle_rwh_06()?;
|
let raw = self.raw_display_handle_rwh_06()?;
|
||||||
|
|
@ -82,7 +79,6 @@ impl rwh_06::HasDisplayHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasWindowHandle for Window {
|
impl rwh_06::HasWindowHandle for Window {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_window_handle_rwh_06()?;
|
let raw = self.raw_window_handle_rwh_06()?;
|
||||||
|
|
@ -323,12 +319,10 @@ impl CoreWindow for Window {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -692,7 +692,6 @@ impl WindowDelegate {
|
||||||
let window = new_window(app_state, &attrs, mtm)
|
let window = new_window(app_state, &attrs, mtm)
|
||||||
.ok_or_else(|| os_error!("couldn't create `NSWindow`"))?;
|
.ok_or_else(|| os_error!("couldn't create `NSWindow`"))?;
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
match attrs.parent_window.map(|handle| handle.0) {
|
match attrs.parent_window.map(|handle| handle.0) {
|
||||||
Some(rwh_06::RawWindowHandle::AppKit(handle)) => {
|
Some(rwh_06::RawWindowHandle::AppKit(handle)) => {
|
||||||
// SAFETY: Caller ensures the pointer is valid or NULL
|
// SAFETY: Caller ensures the pointer is valid or NULL
|
||||||
|
|
@ -1631,7 +1630,6 @@ impl WindowDelegate {
|
||||||
Some(monitor)
|
Some(monitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_window_handle_rwh_06(&self) -> rwh_06::RawWindowHandle {
|
pub fn raw_window_handle_rwh_06(&self) -> rwh_06::RawWindowHandle {
|
||||||
let window_handle = rwh_06::AppKitWindowHandle::new({
|
let window_handle = rwh_06::AppKitWindowHandle::new({
|
||||||
|
|
|
||||||
|
|
@ -98,13 +98,11 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
||||||
RootOwnedDisplayHandle { platform: OwnedDisplayHandle }
|
RootOwnedDisplayHandle { platform: OwnedDisplayHandle }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = rwh_06::RawDisplayHandle::UiKit(rwh_06::UiKitDisplayHandle::new());
|
let raw = rwh_06::RawDisplayHandle::UiKit(rwh_06::UiKitDisplayHandle::new());
|
||||||
|
|
@ -116,7 +114,6 @@ impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
pub(crate) struct OwnedDisplayHandle;
|
pub(crate) struct OwnedDisplayHandle;
|
||||||
|
|
||||||
impl OwnedDisplayHandle {
|
impl OwnedDisplayHandle {
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,6 @@ impl Inner {
|
||||||
self.window.id()
|
self.window.id()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
pub fn raw_window_handle_rwh_06(&self) -> rwh_06::RawWindowHandle {
|
pub fn raw_window_handle_rwh_06(&self) -> rwh_06::RawWindowHandle {
|
||||||
let mut window_handle = rwh_06::UiKitWindowHandle::new({
|
let mut window_handle = rwh_06::UiKitWindowHandle::new({
|
||||||
let ui_view = Retained::as_ptr(&self.view) as _;
|
let ui_view = Retained::as_ptr(&self.view) as _;
|
||||||
|
|
@ -546,7 +545,6 @@ impl Window {
|
||||||
self.inner.get_on_main(|inner| f(inner))
|
self.inner.get_on_main(|inner| f(inner))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) fn raw_window_handle_rwh_06(
|
pub(crate) fn raw_window_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
@ -558,7 +556,6 @@ impl Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) fn raw_display_handle_rwh_06(
|
pub(crate) fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
@ -567,7 +564,6 @@ impl Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for Window {
|
impl rwh_06::HasDisplayHandle for Window {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_display_handle_rwh_06()?;
|
let raw = self.raw_display_handle_rwh_06()?;
|
||||||
|
|
@ -575,7 +571,6 @@ impl rwh_06::HasDisplayHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasWindowHandle for Window {
|
impl rwh_06::HasWindowHandle for Window {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_window_handle_rwh_06()?;
|
let raw = self.raw_window_handle_rwh_06()?;
|
||||||
|
|
@ -815,12 +810,10 @@ impl CoreWindow for Window {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,6 @@ pub(crate) enum OwnedDisplayHandle {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OwnedDisplayHandle {
|
impl OwnedDisplayHandle {
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
||||||
|
|
@ -637,7 +637,6 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
@ -657,7 +656,6 @@ impl ActiveEventLoop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
use sctk::reexports::client::Proxy;
|
use sctk::reexports::client::Proxy;
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,6 @@ impl Drop for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasWindowHandle for Window {
|
impl rwh_06::HasWindowHandle for Window {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = rwh_06::WaylandWindowHandle::new({
|
let raw = rwh_06::WaylandWindowHandle::new({
|
||||||
|
|
@ -260,7 +259,6 @@ impl rwh_06::HasWindowHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for Window {
|
impl rwh_06::HasDisplayHandle for Window {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = rwh_06::WaylandDisplayHandle::new({
|
let raw = rwh_06::WaylandDisplayHandle::new({
|
||||||
|
|
@ -648,13 +646,11 @@ impl CoreWindow for Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the raw-window-handle v0.6 display handle.
|
/// Get the raw-window-handle v0.6 display handle.
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the raw-window-handle v0.6 window handle.
|
/// Get the raw-window-handle v0.6 window handle.
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -647,7 +647,6 @@ impl ActiveEventLoop {
|
||||||
.expect_then_ignore_error("Failed to update device event filter");
|
.expect_then_ignore_error("Failed to update device event filter");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<rwh_06::RawDisplayHandle, rwh_06::HandleError> {
|
) -> Result<rwh_06::RawDisplayHandle, rwh_06::HandleError> {
|
||||||
|
|
@ -748,13 +747,11 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
||||||
RootOwnedDisplayHandle { platform: handle }
|
RootOwnedDisplayHandle { platform: handle }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_display_handle_rwh_06()?;
|
let raw = self.raw_display_handle_rwh_06()?;
|
||||||
|
|
|
||||||
|
|
@ -294,18 +294,15 @@ impl CoreWindow for Window {
|
||||||
.map(|inner| crate::monitor::MonitorHandle { inner })
|
.map(|inner| crate::monitor::MonitorHandle { inner })
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for Window {
|
impl rwh_06::HasDisplayHandle for Window {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.0.raw_display_handle_rwh_06()?;
|
let raw = self.0.raw_display_handle_rwh_06()?;
|
||||||
|
|
@ -313,7 +310,6 @@ impl rwh_06::HasDisplayHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasWindowHandle for Window {
|
impl rwh_06::HasWindowHandle for Window {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.0.raw_window_handle_rwh_06()?;
|
let raw = self.0.raw_window_handle_rwh_06()?;
|
||||||
|
|
@ -443,15 +439,12 @@ impl UnownedWindow {
|
||||||
) -> Result<UnownedWindow, RequestError> {
|
) -> Result<UnownedWindow, RequestError> {
|
||||||
let xconn = &event_loop.xconn;
|
let xconn = &event_loop.xconn;
|
||||||
let atoms = xconn.atoms();
|
let atoms = xconn.atoms();
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
let root = match window_attrs.parent_window.as_ref().map(|handle| handle.0) {
|
let root = match window_attrs.parent_window.as_ref().map(|handle| handle.0) {
|
||||||
Some(rwh_06::RawWindowHandle::Xlib(handle)) => handle.window as xproto::Window,
|
Some(rwh_06::RawWindowHandle::Xlib(handle)) => handle.window as xproto::Window,
|
||||||
Some(rwh_06::RawWindowHandle::Xcb(handle)) => handle.window.get(),
|
Some(rwh_06::RawWindowHandle::Xcb(handle)) => handle.window.get(),
|
||||||
Some(raw) => unreachable!("Invalid raw window handle {raw:?} on X11"),
|
Some(raw) => unreachable!("Invalid raw window handle {raw:?} on X11"),
|
||||||
None => event_loop.root,
|
None => event_loop.root,
|
||||||
};
|
};
|
||||||
#[cfg(not(feature = "rwh_06"))]
|
|
||||||
let root = event_loop.root;
|
|
||||||
|
|
||||||
let mut monitors = leap!(xconn.available_monitors());
|
let mut monitors = leap!(xconn.available_monitors());
|
||||||
let guessed_monitor = if monitors.is_empty() {
|
let guessed_monitor = if monitors.is_empty() {
|
||||||
|
|
@ -2157,7 +2150,6 @@ impl UnownedWindow {
|
||||||
// TODO timer
|
// TODO timer
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_window_handle_rwh_06(&self) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
pub fn raw_window_handle_rwh_06(&self) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
||||||
let mut window_handle = rwh_06::XlibWindowHandle::new(self.xlib_window());
|
let mut window_handle = rwh_06::XlibWindowHandle::new(self.xlib_window());
|
||||||
|
|
@ -2165,7 +2157,6 @@ impl UnownedWindow {
|
||||||
Ok(window_handle.into())
|
Ok(window_handle.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
||||||
|
|
@ -759,13 +759,11 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
||||||
event_loop::OwnedDisplayHandle { platform: OwnedDisplayHandle }
|
event_loop::OwnedDisplayHandle { platform: OwnedDisplayHandle }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = rwh_06::RawDisplayHandle::Orbital(rwh_06::OrbitalDisplayHandle::new());
|
let raw = rwh_06::RawDisplayHandle::Orbital(rwh_06::OrbitalDisplayHandle::new());
|
||||||
|
|
@ -777,7 +775,6 @@ impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
pub(crate) struct OwnedDisplayHandle;
|
pub(crate) struct OwnedDisplayHandle;
|
||||||
|
|
||||||
impl OwnedDisplayHandle {
|
impl OwnedDisplayHandle {
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,6 @@ impl Window {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn raw_window_handle_rwh_06(&self) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
fn raw_window_handle_rwh_06(&self) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
||||||
let handle = rwh_06::OrbitalWindowHandle::new({
|
let handle = rwh_06::OrbitalWindowHandle::new({
|
||||||
|
|
@ -147,7 +146,6 @@ impl Window {
|
||||||
Ok(rwh_06::RawWindowHandle::Orbital(handle))
|
Ok(rwh_06::RawWindowHandle::Orbital(handle))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn raw_display_handle_rwh_06(&self) -> Result<rwh_06::RawDisplayHandle, rwh_06::HandleError> {
|
fn raw_display_handle_rwh_06(&self) -> Result<rwh_06::RawDisplayHandle, rwh_06::HandleError> {
|
||||||
Ok(rwh_06::RawDisplayHandle::Orbital(rwh_06::OrbitalDisplayHandle::new()))
|
Ok(rwh_06::RawDisplayHandle::Orbital(rwh_06::OrbitalDisplayHandle::new()))
|
||||||
|
|
@ -447,18 +445,15 @@ impl CoreWindow for Window {
|
||||||
|
|
||||||
fn set_content_protected(&self, _protected: bool) {}
|
fn set_content_protected(&self, _protected: bool) {}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasWindowHandle for Window {
|
impl rwh_06::HasWindowHandle for Window {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_window_handle_rwh_06()?;
|
let raw = self.raw_window_handle_rwh_06()?;
|
||||||
|
|
@ -466,7 +461,6 @@ impl rwh_06::HasWindowHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for Window {
|
impl rwh_06::HasDisplayHandle for Window {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_display_handle_rwh_06()?;
|
let raw = self.raw_display_handle_rwh_06()?;
|
||||||
|
|
|
||||||
|
|
@ -550,13 +550,11 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
||||||
RootOwnedDisplayHandle { platform: OwnedDisplayHandle }
|
RootOwnedDisplayHandle { platform: OwnedDisplayHandle }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = rwh_06::RawDisplayHandle::Web(rwh_06::WebDisplayHandle::new());
|
let raw = rwh_06::RawDisplayHandle::Web(rwh_06::WebDisplayHandle::new());
|
||||||
|
|
@ -568,7 +566,6 @@ impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
pub(crate) struct OwnedDisplayHandle;
|
pub(crate) struct OwnedDisplayHandle;
|
||||||
|
|
||||||
impl OwnedDisplayHandle {
|
impl OwnedDisplayHandle {
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
||||||
|
|
@ -375,18 +375,15 @@ impl RootWindow for Window {
|
||||||
self.inner.queue(|inner| inner.monitor.primary_monitor()).map(RootMonitorHandle::from)
|
self.inner.queue(|inner| inner.monitor.primary_monitor()).map(RootMonitorHandle::from)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasWindowHandle for Window {
|
impl rwh_06::HasWindowHandle for Window {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
MainThreadMarker::new()
|
MainThreadMarker::new()
|
||||||
|
|
@ -408,7 +405,6 @@ impl rwh_06::HasWindowHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for Window {
|
impl rwh_06::HasDisplayHandle for Window {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
Ok(rwh_06::DisplayHandle::web())
|
Ok(rwh_06::DisplayHandle::web())
|
||||||
|
|
|
||||||
|
|
@ -524,7 +524,6 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = rwh_06::RawDisplayHandle::Windows(rwh_06::WindowsDisplayHandle::new());
|
let raw = rwh_06::RawDisplayHandle::Windows(rwh_06::WindowsDisplayHandle::new());
|
||||||
|
|
@ -536,7 +535,6 @@ impl rwh_06::HasDisplayHandle for ActiveEventLoop {
|
||||||
pub(crate) struct OwnedDisplayHandle;
|
pub(crate) struct OwnedDisplayHandle;
|
||||||
|
|
||||||
impl OwnedDisplayHandle {
|
impl OwnedDisplayHandle {
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,6 @@ impl Window {
|
||||||
self.window
|
self.window
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
pub unsafe fn rwh_06_no_thread_check(
|
pub unsafe fn rwh_06_no_thread_check(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
||||||
|
|
@ -119,7 +118,6 @@ impl Window {
|
||||||
Ok(rwh_06::RawWindowHandle::Win32(window_handle))
|
Ok(rwh_06::RawWindowHandle::Win32(window_handle))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
pub fn raw_window_handle_rwh_06(&self) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
pub fn raw_window_handle_rwh_06(&self) -> Result<rwh_06::RawWindowHandle, rwh_06::HandleError> {
|
||||||
// TODO: Write a test once integration framework is ready to ensure that it holds.
|
// TODO: Write a test once integration framework is ready to ensure that it holds.
|
||||||
// If we aren't in the GUI thread, we can't return the window.
|
// If we aren't in the GUI thread, we can't return the window.
|
||||||
|
|
@ -132,7 +130,6 @@ impl Window {
|
||||||
unsafe { self.rwh_06_no_thread_check() }
|
unsafe { self.rwh_06_no_thread_check() }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
pub fn raw_display_handle_rwh_06(
|
pub fn raw_display_handle_rwh_06(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<rwh_06::RawDisplayHandle, rwh_06::HandleError> {
|
) -> Result<rwh_06::RawDisplayHandle, rwh_06::HandleError> {
|
||||||
|
|
@ -349,7 +346,6 @@ impl Drop for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for Window {
|
impl rwh_06::HasDisplayHandle for Window {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_display_handle_rwh_06()?;
|
let raw = self.raw_display_handle_rwh_06()?;
|
||||||
|
|
@ -357,7 +353,6 @@ impl rwh_06::HasDisplayHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasWindowHandle for Window {
|
impl rwh_06::HasWindowHandle for Window {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
let raw = self.raw_window_handle_rwh_06()?;
|
let raw = self.raw_window_handle_rwh_06()?;
|
||||||
|
|
@ -1054,12 +1049,10 @@ impl CoreWindow for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
@ -1288,7 +1281,6 @@ unsafe fn init(
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
let parent = match attributes.parent_window.as_ref().map(|handle| handle.0) {
|
let parent = match attributes.parent_window.as_ref().map(|handle| handle.0) {
|
||||||
Some(rwh_06::RawWindowHandle::Win32(handle)) => {
|
Some(rwh_06::RawWindowHandle::Win32(handle)) => {
|
||||||
window_flags.set(WindowFlags::CHILD, true);
|
window_flags.set(WindowFlags::CHILD, true);
|
||||||
|
|
@ -1301,9 +1293,6 @@ unsafe fn init(
|
||||||
None => fallback_parent(),
|
None => fallback_parent(),
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(not(feature = "rwh_06"))]
|
|
||||||
let parent = fallback_parent();
|
|
||||||
|
|
||||||
let menu = attributes.platform_specific.menu;
|
let menu = attributes.platform_specific.menu;
|
||||||
let fullscreen = attributes.fullscreen.clone();
|
let fullscreen = attributes.fullscreen.clone();
|
||||||
let maximized = attributes.maximized;
|
let maximized = attributes.maximized;
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@ pub struct WindowAttributes {
|
||||||
pub window_level: WindowLevel,
|
pub window_level: WindowLevel,
|
||||||
pub active: bool,
|
pub active: bool,
|
||||||
pub cursor: Cursor,
|
pub cursor: Cursor,
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
pub(crate) parent_window: Option<SendSyncRawWindowHandle>,
|
pub(crate) parent_window: Option<SendSyncRawWindowHandle>,
|
||||||
pub fullscreen: Option<Fullscreen>,
|
pub fullscreen: Option<Fullscreen>,
|
||||||
// Platform-specific configuration.
|
// Platform-specific configuration.
|
||||||
|
|
@ -98,7 +97,6 @@ impl Default for WindowAttributes {
|
||||||
preferred_theme: None,
|
preferred_theme: None,
|
||||||
content_protected: false,
|
content_protected: false,
|
||||||
cursor: Cursor::default(),
|
cursor: Cursor::default(),
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
parent_window: None,
|
parent_window: None,
|
||||||
active: true,
|
active: true,
|
||||||
platform_specific: Default::default(),
|
platform_specific: Default::default(),
|
||||||
|
|
@ -113,17 +111,13 @@ impl Default for WindowAttributes {
|
||||||
/// The user has to account for that when using [`WindowAttributes::with_parent_window()`],
|
/// The user has to account for that when using [`WindowAttributes::with_parent_window()`],
|
||||||
/// which is `unsafe`.
|
/// which is `unsafe`.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
pub(crate) struct SendSyncRawWindowHandle(pub(crate) rwh_06::RawWindowHandle);
|
pub(crate) struct SendSyncRawWindowHandle(pub(crate) rwh_06::RawWindowHandle);
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
unsafe impl Send for SendSyncRawWindowHandle {}
|
unsafe impl Send for SendSyncRawWindowHandle {}
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
unsafe impl Sync for SendSyncRawWindowHandle {}
|
unsafe impl Sync for SendSyncRawWindowHandle {}
|
||||||
|
|
||||||
impl WindowAttributes {
|
impl WindowAttributes {
|
||||||
/// Get the parent window stored on the attributes.
|
/// Get the parent window stored on the attributes.
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
pub fn parent_window(&self) -> Option<&rwh_06::RawWindowHandle> {
|
pub fn parent_window(&self) -> Option<&rwh_06::RawWindowHandle> {
|
||||||
self.parent_window.as_ref().map(|handle| &handle.0)
|
self.parent_window.as_ref().map(|handle| &handle.0)
|
||||||
}
|
}
|
||||||
|
|
@ -409,7 +403,6 @@ impl WindowAttributes {
|
||||||
/// <https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features#child-windows>
|
/// <https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features#child-windows>
|
||||||
/// - **X11**: A child window is confined to the client area of its parent window.
|
/// - **X11**: A child window is confined to the client area of its parent window.
|
||||||
/// - **Android / iOS / Wayland / Web:** Unsupported.
|
/// - **Android / iOS / Wayland / Web:** Unsupported.
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn with_parent_window(
|
pub unsafe fn with_parent_window(
|
||||||
mut self,
|
mut self,
|
||||||
|
|
@ -1276,11 +1269,9 @@ pub trait Window: AsAny + Send + Sync {
|
||||||
fn primary_monitor(&self) -> Option<MonitorHandle>;
|
fn primary_monitor(&self) -> Option<MonitorHandle>;
|
||||||
|
|
||||||
/// Get the raw-window-handle v0.6 display handle.
|
/// Get the raw-window-handle v0.6 display handle.
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle;
|
fn rwh_06_display_handle(&self) -> &dyn rwh_06::HasDisplayHandle;
|
||||||
|
|
||||||
/// Get the raw-window-handle v0.6 window handle.
|
/// Get the raw-window-handle v0.6 window handle.
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle;
|
fn rwh_06_window_handle(&self) -> &dyn rwh_06::HasWindowHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1306,14 +1297,12 @@ impl std::hash::Hash for dyn Window + '_ {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasDisplayHandle for dyn Window + '_ {
|
impl rwh_06::HasDisplayHandle for dyn Window + '_ {
|
||||||
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
fn display_handle(&self) -> Result<rwh_06::DisplayHandle<'_>, rwh_06::HandleError> {
|
||||||
self.rwh_06_display_handle().display_handle()
|
self.rwh_06_display_handle().display_handle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rwh_06")]
|
|
||||||
impl rwh_06::HasWindowHandle for dyn Window + '_ {
|
impl rwh_06::HasWindowHandle for dyn Window + '_ {
|
||||||
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
|
||||||
self.rwh_06_window_handle().window_handle()
|
self.rwh_06_window_handle().window_handle()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue