From fceeddad8d67ccf9fffe2142eb9bed3df0d65869 Mon Sep 17 00:00:00 2001 From: Max Booth Date: Tue, 22 Oct 2024 15:10:00 -0400 Subject: [PATCH] updating smithay --- Cargo.lock | 41 +++++++++++++++------------- src/server/client_handlers.rs | 17 ++++++++---- src/server/smithay_handlers.rs | 23 ++++++++++------ src/xwayland_xdg_shell/client.rs | 7 +++-- src/xwayland_xdg_shell/compositor.rs | 12 ++++---- src/xwayland_xdg_shell/mod.rs | 2 +- 6 files changed, 60 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 466c4906..e4af911d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -192,23 +192,22 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "calloop" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +checksum = "a1ead1e1514bce44c0f40e027899fbc595907fc112635bed21b3b5d975c0a5e7" dependencies = [ "bitflags 2.6.0", - "log", "polling", "rustix", "slab", - "thiserror", + "tracing", ] [[package]] name = "calloop-wayland-source" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +checksum = "876a7a1dbbe026a55ef47a500b123af5a9a0914520f061d467914cf21be95daf" dependencies = [ "calloop", "rustix", @@ -1363,12 +1362,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scan_fmt" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b53b0a5db882a8e2fdaae0a43f7b39e7e9082389e978398bdf223a55b581248" - [[package]] name = "scoped-tls" version = "1.0.1" @@ -1467,7 +1460,7 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smithay" version = "0.3.0" -source = "git+https://github.com/Smithay/smithay.git#6169b213fb663d85d2e139d3bbe44dfae1ec9328" +source = "git+https://github.com/Smithay/smithay.git#2cee41cdffd111a758b60d230b591367012887a7" dependencies = [ "appendlist", "bitflags 2.6.0", @@ -1479,13 +1472,11 @@ dependencies = [ "encoding_rs", "errno", "indexmap", - "lazy_static", "libc", "once_cell", "profiling", "rand", "rustix", - "scan_fmt", "scopeguard", "smallvec", "tempfile", @@ -1496,13 +1487,13 @@ dependencies = [ "wayland-protocols-wlr", "wayland-server", "x11rb", - "xkbcommon", + "xkbcommon 0.8.0", ] [[package]] name = "smithay-client-toolkit" -version = "0.19.1" -source = "git+https://github.com/Smithay/client-toolkit.git#ac2c420cae253242dc5650b7a347573e2a036c86" +version = "0.19.2" +source = "git+https://github.com/Smithay/client-toolkit.git#618a876400cb6c6b07a8ac5d3557f404602ec077" dependencies = [ "bitflags 2.6.0", "bytemuck", @@ -1522,7 +1513,7 @@ dependencies = [ "wayland-protocols", "wayland-protocols-wlr", "wayland-scanner", - "xkbcommon", + "xkbcommon 0.7.0", "xkeysym", ] @@ -1689,6 +1680,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2365,6 +2357,17 @@ dependencies = [ "xkeysym", ] +[[package]] +name = "xkbcommon" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d66ca9352cbd4eecbbc40871d8a11b4ac8107cfc528a6e14d7c19c69d0e1ac9" +dependencies = [ + "libc", + "memmap2 0.9.5", + "xkeysym", +] + [[package]] name = "xkeysym" version = "0.2.1" diff --git a/src/server/client_handlers.rs b/src/server/client_handlers.rs index 32232bb2..d1559269 100644 --- a/src/server/client_handlers.rs +++ b/src/server/client_handlers.rs @@ -135,7 +135,7 @@ impl WprsServerState { let serial = self.serial_map.insert(serial); pointer.motion( self, - Some((surface, (0, 0).into())), + Some((surface, (0 as f64, 0 as f64).into())), &MotionEvent { location: event.position.into(), serial, @@ -180,7 +180,7 @@ impl WprsServerState { debug!("pointer moved to {:?}", event.position); pointer.motion( self, - Some((surface, (0, 0).into())), + Some((surface, (0 as f64, 0 as f64).into())), &MotionEvent { location: event.position.into(), serial: 0.into(), // unused @@ -257,7 +257,7 @@ impl WprsServerState { keyboard.input::<(), _>( self, - keycode, + keycode.into(), state, serial, self.start_time.elapsed().as_millis() as u32, @@ -723,7 +723,11 @@ impl WprsServerState { let serial = self.serial_map.insert(drag_enter.serial); let pointer = self.seat.get_pointer().location(loc!())?; - let grab = DndGrab::new(Some((surface, (0, 0).into())), 0, drag_enter.loc.into()); + let grab = DndGrab::new( + Some((surface, (0 as f64, 0 as f64).into())), + 0, + drag_enter.loc.into(), + ); pointer.set_grab(self, grab, serial, Focus::Keep); let drag_start_data = pointer.grab_start_data(); debug!("DRAG GRAB: pointer.grab_start_data {:?}", drag_start_data); @@ -767,7 +771,10 @@ impl WprsServerState { if let Some(grab_start_data) = pointer.grab_start_data() { pointer.motion( self, - Some((grab_start_data.focus.location(loc!())?.0, (0, 0).into())), + Some(( + grab_start_data.focus.location(loc!())?.0, + (0 as f64, 0 as f64).into(), + )), &MotionEvent { location: drag_motion.into(), serial: 0.into(), // unused diff --git a/src/server/smithay_handlers.rs b/src/server/smithay_handlers.rs index 2f98fbbb..bacbd337 100644 --- a/src/server/smithay_handlers.rs +++ b/src/server/smithay_handlers.rs @@ -596,7 +596,8 @@ pub fn get_child_positions(surface: &WlSurface) -> Vec { position: compositor::with_states(child, |surface_data| { surface_data .cached_state - .pending::() + .get::() + .pending() .location .into() }), @@ -656,7 +657,9 @@ pub fn set_transformation( #[instrument(skip_all, level = "debug")] pub fn set_xdg_surface_attributes(surface_data: &SurfaceData, surface_state: &mut SurfaceState) { if surface_data.cached_state.has::() { - let surface_cached_state = surface_data.cached_state.current::(); + let mut guard = surface_data.cached_state.get::(); + let surface_cached_state = guard.current(); + let xdg_surface_state = XdgSurfaceState { window_geometry: surface_cached_state .geometry @@ -744,7 +747,8 @@ pub fn commit_impl( position: (0, 0).into(), }); - let mut surface_attributes = surface_data.cached_state.current::(); + let mut guard = surface_data.cached_state.get::(); + let surface_attributes = guard.current(); let mut frame_callbacks = mem::take(&mut surface_attributes.frame_callbacks); if !frame_callbacks.is_empty() { @@ -786,8 +790,8 @@ pub fn commit_impl( .expect("timer registration should never fail"); } - set_regions(&surface_attributes, surface_state); - set_transformation(&surface_attributes, surface_state); + set_regions(surface_attributes, surface_state); + set_transformation(surface_attributes, surface_state); set_xdg_surface_attributes(surface_data, surface_state); match &mut surface_state.role { @@ -796,7 +800,8 @@ pub fn commit_impl( subsurface_state.sync = sync; subsurface_state.location = surface_data .cached_state - .pending::() + .get::() + .pending() .location .into(); }, @@ -1037,7 +1042,7 @@ impl DndGrab { pub fn new( focus: Option<( ::PointerFocus, - Point, + Point, )>, button: u32, location: (f64, f64), @@ -1064,7 +1069,7 @@ impl PointerGrab for DndGrab { _handle: &mut PointerInnerHandle<'_, WprsServerState>, focus: Option<( ::PointerFocus, - Point, + Point, )>, event: &MotionEvent, ) { @@ -1077,7 +1082,7 @@ impl PointerGrab for DndGrab { _handle: &mut PointerInnerHandle<'_, WprsServerState>, focus: Option<( ::PointerFocus, - Point, + Point, )>, event: &RelativeMotionEvent, ) { diff --git a/src/xwayland_xdg_shell/client.rs b/src/xwayland_xdg_shell/client.rs index 1efb888e..37aa3160 100644 --- a/src/xwayland_xdg_shell/client.rs +++ b/src/xwayland_xdg_shell/client.rs @@ -256,7 +256,8 @@ impl CompositorHandler for WprsState { compositor::with_states(&wl_surface, |surface_data| { for callback in surface_data .cached_state - .current::() + .get::() + .current() .frame_callbacks .drain(..) { @@ -844,7 +845,7 @@ impl PointerHandler for WprsState { let serial = self.compositor_state.serial_map.insert(serial); compositor_pointer.motion( self, - Some((x11_surface, (0, 0).into())), + Some((x11_surface, (0 as f64, 0 as f64).into())), &MotionEvent { location: event.position.into(), serial, @@ -867,7 +868,7 @@ impl PointerHandler for WprsState { PointerEventKind::Motion { time } => { compositor_pointer.motion( self, - Some((x11_surface, (0, 0).into())), + Some((x11_surface, (0 as f64, 0 as f64).into())), &MotionEvent { location: event.position.into(), serial: 0.into(), // unused diff --git a/src/xwayland_xdg_shell/compositor.rs b/src/xwayland_xdg_shell/compositor.rs index b9a4325b..67ab26b7 100644 --- a/src/xwayland_xdg_shell/compositor.rs +++ b/src/xwayland_xdg_shell/compositor.rs @@ -63,6 +63,7 @@ use smithay::wayland::shm::ShmHandler; use smithay::wayland::shm::ShmState; use smithay::wayland::xwayland_shell::XWaylandShellHandler; use smithay::wayland::xwayland_shell::XWaylandShellState; +use smithay::xwayland::xwm::XwmId; use smithay::xwayland::X11Surface; use smithay::xwayland::X11Wm; use smithay::xwayland::XWayland; @@ -73,7 +74,6 @@ use smithay_client_toolkit::reexports::csd_frame::DecorationsFrame; use smithay_client_toolkit::reexports::protocols::xdg::shell::client::xdg_surface; use smithay_client_toolkit::shell::xdg::XdgSurface; use smithay_client_toolkit::shell::WaylandSurface; -use x11rb::protocol::xproto::Window; use crate::compositor_utils; use crate::fallible_entry::FallibleEntryExt; @@ -328,11 +328,11 @@ impl XWaylandShellHandler for WprsState { &mut self.compositor_state.xwayland_shell_state } - fn surface_associated(&mut self, surface: WlSurface, window: Window) { + fn surface_associated(&mut self, _xwm: XwmId, wl_surface: WlSurface, surface: X11Surface) { // TODO: we should implement this and get rid of the deferring commit logic below debug!( "X11 window {:?} associated with surface {:?}", - window, surface + surface, wl_surface ) } } @@ -488,7 +488,9 @@ pub fn commit_inner( surface_data: &SurfaceData, state: &mut WprsState, ) -> Result<()> { - let mut surface_attributes = surface_data.cached_state.current::(); + let mut guard = surface_data.cached_state.get::(); + let surface_attributes = guard.current(); + let x11_surface = state .compositor_state .x11_surfaces @@ -624,7 +626,7 @@ pub fn commit_inner( compositor_utils::send_frames( surface, &surface_data.data_map, - &mut surface_attributes, + surface_attributes, state.compositor_state.start_time.elapsed(), Duration::ZERO, ) diff --git a/src/xwayland_xdg_shell/mod.rs b/src/xwayland_xdg_shell/mod.rs index 92df63d8..2ff9daf1 100644 --- a/src/xwayland_xdg_shell/mod.rs +++ b/src/xwayland_xdg_shell/mod.rs @@ -435,7 +435,7 @@ impl WprsState { keyboard.input::<(), _>( self, - keycode, + keycode.into(), state, serial, self.compositor_state.start_time.elapsed().as_millis() as u32,