chore: remove platform WindowId's

WindowId is a window _identifier_, and as such doesn't store anything
(unlike a _handle_). So we can safely make only be defined once, in the
core crate.

There are a few backends where we still use `into_raw` internally; I
consider these patterns discouraged, we should not be passing around
important state in the window id.
This commit is contained in:
Mads Marquart 2024-10-08 15:29:40 +02:00 committed by GitHub
parent eccd9e415d
commit da2268ae22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 226 additions and 379 deletions

View file

@ -107,19 +107,6 @@ impl Default for PlatformSpecificWindowAttributes {
pub(crate) static X11_BACKEND: Lazy<Mutex<Result<Arc<XConnection>, XNotSupported>>> =
Lazy::new(|| Mutex::new(XConnection::new(Some(x_error_callback)).map(Arc::new)));
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WindowId(u64);
impl WindowId {
pub const fn into_raw(self) -> u64 {
self.0
}
pub const fn from_raw(id: u64) -> Self {
Self(id)
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum DeviceId {
#[cfg(x11_platform)]