diff --git a/src/shell/layout/tiling/grabs/resize.rs b/src/shell/layout/tiling/grabs/resize.rs index b6452168..6bb24929 100644 --- a/src/shell/layout/tiling/grabs/resize.rs +++ b/src/shell/layout/tiling/grabs/resize.rs @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -use std::cell::Cell; - use crate::{ backend::render::cursor::CursorState, shell::{ @@ -52,7 +50,6 @@ pub struct ResizeForkTarget { pub output: WeakOutput, pub left_up_idx: usize, pub orientation: Orientation, - pub last_tablet_location: Cell>>, } impl IsAlive for ResizeForkTarget { @@ -193,10 +190,9 @@ impl TabletToolTarget for ResizeForkTarget { let serial = event.serial; let time = event.time; let tool = tool_descriptor.clone(); - let Some(location) = self.last_tablet_location.take() else { - return; - }; data.common.event_loop_handle.insert_idle(move |state| { + let pointer = seat.get_pointer().unwrap(); + let location = pointer.current_location(); let tablet = seat.tablet_seat().get_tool(&tool).unwrap(); tablet.set_grab( state, @@ -205,11 +201,11 @@ impl TabletToolTarget for ResizeForkTarget { tool, data: TabletToolGrabStartData { focus: None, - location: location.as_logical(), + location: location, trigger: TabletToolGrabTrigger::Tip, }, }, - location, + location.as_global(), node, left_up_idx, orientation, @@ -227,10 +223,8 @@ impl TabletToolTarget for ResizeForkTarget { _seat: &Seat, _data: &mut State, _tool_descriptor: &TabletToolDescriptor, - event: &TabletMotionEvent, + _event: &TabletMotionEvent, ) { - self.last_tablet_location - .set(Some(event.location.as_global())) } fn proximity_out( &self, @@ -238,7 +232,6 @@ impl TabletToolTarget for ResizeForkTarget { _data: &mut State, _tool_descriptor: &TabletToolDescriptor, ) { - self.last_tablet_location.set(None); } fn proximity_in( diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index 2f694acd..8706dc59 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -67,7 +67,6 @@ use smithay::{ wayland::{compositor::add_blocker, seat::WaylandFocus}, }; use std::{ - cell::Cell, collections::{HashMap, VecDeque}, sync::{Arc, Weak}, time::{Duration, Instant}, @@ -3349,7 +3348,6 @@ impl TilingLayout { output: self.output.downgrade(), left_up_idx: idx, orientation, - last_tablet_location: Cell::new(None), } .into(), (last_geometry.loc