MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / send_motion

Method send_motion

src/core/seat/pointer.cpp:296–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296void wf::pointer_t::send_motion(uint32_t time_msec)
297{
298 if (cursor_focus)
299 {
300 auto gc = wf::get_core().get_cursor_position();
301 auto local = get_node_local_coords(cursor_focus.get(), gc);
302
303 if (!last_focus_coords.has_value() ||
304 (local.x != last_focus_coords->x) || (local.y != last_focus_coords->y))
305 {
306 // NB: the pointer motion could go to a grab, which could trigger scenegraph changes, which
307 // trigger re-focus. We need to set the last focus coordinates early, so that we break out of
308 // infinite loops.
309 last_focus_coords = local;
310 cursor_focus->pointer_interaction().handle_pointer_motion(local, time_msec);
311 }
312 }
313}
314
315void wf::pointer_t::handle_pointer_motion(wlr_pointer_motion_event *ev,
316 input_event_processing_mode_t mode)

Callers 1

Calls 4

get_node_local_coordsFunction · 0.85
get_cursor_positionMethod · 0.45
getMethod · 0.45
handle_pointer_motionMethod · 0.45

Tested by

no test coverage detected