Update wayland-rs to 0.30.0

This update rewrites the winit's Wayland backend using new wayland-rs
0.30 API. This fixes long standing issue with the forward compatibility
of the wayland backend, meaning that future updates to the wayland
protocol won't break rust code anymore. like it was before when adding
new shm/enum variants into the protocol.

Fixes #2560.
Fixes #2164.
Fixes #2128.
Fixes #1760.
Fixes #725.
This commit is contained in:
Kirill Chibisov 2023-04-19 00:56:29 +03:00 committed by GitHub
parent 60e91b187a
commit 2496098890
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 3515 additions and 3458 deletions

View file

@ -1,19 +1,23 @@
#![cfg(wayland_platform)]
//! Winit's Wayland backend.
use sctk::reexports::client::protocol::wl_surface::WlSurface;
use sctk::reexports::client::Proxy;
pub use crate::platform_impl::platform::WindowId;
pub use event_loop::{EventLoop, EventLoopProxy, EventLoopWindowTarget};
pub use output::{MonitorHandle, VideoMode};
pub use window::Window;
mod env;
mod event_loop;
mod output;
mod protocols;
mod seat;
mod state;
mod types;
mod window;
/// Dummy device id, since Wayland doesn't have device events.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId;
@ -23,7 +27,8 @@ impl DeviceId {
}
}
/// Get the WindowId out of the surface.
#[inline]
fn make_wid(surface: &WlSurface) -> WindowId {
WindowId(surface.as_ref().c_ptr() as u64)
WindowId(surface.id().as_ptr() as u64)
}