diff --git a/Cargo.toml b/Cargo.toml index 9bd02cc..f6a137a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ tiny-skia = { version = "0.12", default-features = false, features = [ "std", "simd", ] } -smithay-client-toolkit = { version = "0.20.0", default-features = false } +smithay-client-toolkit = { git = "https://github.com/ids1024/client-toolkit", branch = "wayland-update", default-features = false } # Draw title text using crossfont `--features crossfont` crossfont = { version = "0.9.0", optional = true } @@ -38,3 +38,12 @@ tiny-skia = { version = "0.12", default-features = false, features = [ default = ["ab_glyph"] crossfont = ["dep:crossfont"] ab_glyph = ["dep:ab_glyph", "memmap2"] + +[patch.crates-io] +wayland-client = { git = "https://github.com/smithay/wayland-rs" } +wayland-protocols = { git = "https://github.com/smithay/wayland-rs" } +wayland-protocols-wlr = { git = "https://github.com/smithay/wayland-rs" } +wayland-protocols-misc = { git = "https://github.com/smithay/wayland-rs" } +wayland-protocols-experimental = { git = "https://github.com/smithay/wayland-rs" } +wayland-cursor = { git = "https://github.com/smithay/wayland-rs" } +wayland-backend = { git = "https://github.com/smithay/wayland-rs" } diff --git a/src/lib.rs b/src/lib.rs index aedd1bb..8721c03 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,18 +23,17 @@ use tiny_skia::{ use smithay_client_toolkit::reexports::client::backend::ObjectId; use smithay_client_toolkit::reexports::client::protocol::wl_shm; -use smithay_client_toolkit::reexports::client::protocol::wl_subsurface::WlSubsurface; use smithay_client_toolkit::reexports::client::protocol::wl_surface::WlSurface; -use smithay_client_toolkit::reexports::client::{Dispatch, Proxy, QueueHandle}; +use smithay_client_toolkit::reexports::client::{Proxy, QueueHandle}; use smithay_client_toolkit::reexports::csd_frame::{ CursorIcon, DecorationsFrame, FrameAction, FrameClick, WindowManagerCapabilities, WindowState, }; -use smithay_client_toolkit::compositor::{CompositorState, Region, SurfaceData}; +use smithay_client_toolkit::compositor::{CompositorHandler, CompositorState, Region, SurfaceData}; +use smithay_client_toolkit::output::OutputHandler; use smithay_client_toolkit::shell::WaylandSurface; use smithay_client_toolkit::shm::{slot::SlotPool, Shm}; use smithay_client_toolkit::subcompositor::SubcompositorState; -use smithay_client_toolkit::subcompositor::SubsurfaceData; mod buttons; mod config; @@ -63,7 +62,7 @@ type SkiaResult = Option<()>; #[derive(Debug)] pub struct AdwaitaFrame { /// The base surface used to create the window. - base_surface: WlTyped, + base_surface: WlTyped>, compositor: Arc, @@ -110,7 +109,7 @@ pub struct AdwaitaFrame { impl AdwaitaFrame where - State: Dispatch + Dispatch + 'static, + State: CompositorHandler + OutputHandler + 'static, { pub fn new( base_surface: &impl WaylandSurface, @@ -378,7 +377,7 @@ where impl DecorationsFrame for AdwaitaFrame where - State: Dispatch + Dispatch + 'static, + State: CompositorHandler + OutputHandler + 'static, { fn update_state(&mut self, state: WindowState) { let difference = self.state.symmetric_difference(state); diff --git a/src/parts.rs b/src/parts.rs index 0b7f75b..7525ed8 100644 --- a/src/parts.rs +++ b/src/parts.rs @@ -1,11 +1,12 @@ use smithay_client_toolkit::reexports::client::{ backend::ObjectId, protocol::{wl_subsurface::WlSubsurface, wl_surface::WlSurface}, - Dispatch, Proxy, QueueHandle, + Proxy, QueueHandle, }; use smithay_client_toolkit::{ - compositor::SurfaceData, + compositor::{CompositorHandler, SurfaceData}, + output::OutputHandler, subcompositor::{SubcompositorState, SubsurfaceData}, }; @@ -53,12 +54,12 @@ pub struct DecorationParts { impl DecorationParts { pub fn new( - base_surface: &WlTyped, + base_surface: &WlTyped>, subcompositor: &SubcompositorState, queue_handle: &QueueHandle, ) -> Self where - State: Dispatch + Dispatch + 'static, + State: CompositorHandler + OutputHandler + 'static, { let parts = [ Part::new(base_surface, subcompositor, queue_handle), @@ -295,7 +296,7 @@ pub struct Rect { #[derive(Debug)] pub struct Part { - pub surface: WlTyped, + pub surface: WlTyped>, pub subsurface: WlTyped, /// Positioned relative to the main surface. @@ -310,12 +311,12 @@ pub struct Part { impl Part { fn new( - parent: &WlTyped, + parent: &WlTyped>, subcompositor: &SubcompositorState, queue_handle: &QueueHandle, ) -> Part where - State: Dispatch + Dispatch + 'static, + State: CompositorHandler + OutputHandler + 'static, { let (subsurface, surface) = subcompositor.create_subsurface(parent.inner().clone(), queue_handle); diff --git a/src/wl_typed.rs b/src/wl_typed.rs index 26b6c11..c46b63c 100644 --- a/src/wl_typed.rs +++ b/src/wl_typed.rs @@ -13,7 +13,7 @@ where #[allow(clippy::extra_unused_type_parameters)] pub fn wrap(i: I) -> Self where - STATE: Dispatch, + DATA: Dispatch, { Self(i, PhantomData) }