diff options
Diffstat (limited to 'src/input/mod.rs')
| -rw-r--r-- | src/input/mod.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index b3e38892..11612f2f 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -24,7 +24,10 @@ use smithay::input::pointer::{ GestureSwipeBeginEvent, GestureSwipeEndEvent, GestureSwipeUpdateEvent, GrabStartData as PointerGrabStartData, MotionEvent, RelativeMotionEvent, }; -use smithay::input::touch::{DownEvent, MotionEvent as TouchMotionEvent, UpEvent}; +use smithay::input::touch::{ + DownEvent, GrabStartData as TouchGrabStartData, MotionEvent as TouchMotionEvent, UpEvent, +}; +use smithay::input::SeatHandler; use smithay::utils::{Logical, Point, Rectangle, Transform, SERIAL_COUNTER}; use smithay::wayland::pointer_constraints::{with_pointer_constraint, PointerConstraint}; use smithay::wayland::tablet_manager::{TabletDescriptor, TabletSeatTrait}; @@ -42,6 +45,7 @@ pub mod resize_grab; pub mod scroll_tracker; pub mod spatial_movement_grab; pub mod swipe_tracker; +pub mod touch_move_grab; pub const DOUBLE_CLICK_TIME: Duration = Duration::from_millis(400); @@ -56,6 +60,20 @@ pub struct TabletData { pub aspect_ratio: f64, } +pub enum PointerOrTouchStartData<D: SeatHandler> { + Pointer(PointerGrabStartData<D>), + Touch(TouchGrabStartData<D>), +} + +impl<D: SeatHandler> PointerOrTouchStartData<D> { + pub fn location(&self) -> Point<f64, Logical> { + match self { + PointerOrTouchStartData::Pointer(x) => x.location, + PointerOrTouchStartData::Touch(x) => x.location, + } + } +} + impl State { pub fn process_input_event<I: InputBackend + 'static>(&mut self, event: InputEvent<I>) where |
