MCPcopy Create free account
hub / github.com/StrataWM/strata / pointer_motion

Method pointer_motion

src/handlers/input.rs:2647–2679  ·  view source on GitHub ↗
(
		&mut self,
		event: I::PointerMotionEvent,
	)

Source from the content-addressed store, hash-verified

2645 }
2646
2647 pub fn pointer_motion<I: InputBackend>(
2648 &mut self,
2649 event: I::PointerMotionEvent,
2650 ) -> anyhow::Result<()> {
2651 let serial = SERIAL_COUNTER.next_serial();
2652 let delta = (event.delta_x(), event.delta_y()).into();
2653
2654 self.set_input_focus_auto();
2655
2656 if let Some(ptr) = self.seat.get_pointer() {
2657 let location = self.workspaces.current().clamp_coords(ptr.current_location() + delta);
2658
2659 let under = self.surface_under();
2660
2661 ptr.motion(
2662 self,
2663 under.clone(),
2664 &MotionEvent { location, serial, time: event.time_msec() },
2665 );
2666
2667 ptr.relative_motion(
2668 self,
2669 under,
2670 &RelativeMotionEvent {
2671 delta,
2672 delta_unaccel: event.delta_unaccel(),
2673 utime: event.time(),
2674 },
2675 )
2676 }
2677
2678 Ok(())
2679 }
2680
2681 pub fn pointer_motion_absolute<I: InputBackend>(
2682 &mut self,

Callers

nothing calls this directly

Calls 6

set_input_focus_autoMethod · 0.80
clamp_coordsMethod · 0.80
currentMethod · 0.80
surface_underMethod · 0.80
motionMethod · 0.80
relative_motionMethod · 0.80

Tested by

no test coverage detected