input: move notify-idle-manager to tablet/touch handlers

Move them away from the cursor emulate functions. This
avoid calling them twice for touch motion.

Also notify idle manager on touch down/up.
This commit is contained in:
Jens Peters 2024-10-29 20:39:17 +01:00 committed by Hiroaki Yamamoto
parent eed972cef1
commit 7e0cd8ee5a
3 changed files with 13 additions and 10 deletions

View file

@ -61,6 +61,7 @@ handle_touch_motion(struct wl_listener *listener, void *data)
{
struct seat *seat = wl_container_of(listener, seat, touch_motion);
struct wlr_touch_motion_event *event = data;
idle_manager_notify_activity(seat->seat);
int touch_point_count = wl_list_length(&seat->touch_points);
@ -110,6 +111,8 @@ handle_touch_down(struct wl_listener *listener, void *data)
struct seat *seat = wl_container_of(listener, seat, touch_down);
struct wlr_touch_down_event *event = data;
idle_manager_notify_activity(seat->seat);
/* Compute layout => surface offset and save for this touch point */
struct touch_point *touch_point = znew(*touch_point);
double x_offset = 0.0, y_offset = 0.0;
@ -167,6 +170,8 @@ handle_touch_up(struct wl_listener *listener, void *data)
struct seat *seat = wl_container_of(listener, seat, touch_up);
struct wlr_touch_up_event *event = data;
idle_manager_notify_activity(seat->seat);
/* Remove the touch point from the seat */
struct touch_point *touch_point, *tmp;
wl_list_for_each_safe(touch_point, tmp, &seat->touch_points, link) {