diff --git a/seat.c b/seat.c index a7977ca..04d92e0 100644 --- a/seat.c +++ b/seat.c @@ -450,6 +450,15 @@ handle_touch_motion(struct wl_listener *listener, void *data) wlr_idle_notify_activity(seat->server->idle, seat->seat); } +static void +handle_cursor_frame(struct wl_listener *listener, void *data) +{ + struct cg_seat *seat = wl_container_of(listener, seat, cursor_frame); + + wlr_seat_pointer_notify_frame(seat->seat); + wlr_idle_notify_activity(seat->server->idle, seat->seat); +} + static void handle_cursor_axis(struct wl_listener *listener, void *data) { @@ -617,6 +626,7 @@ handle_destroy(struct wl_listener *listener, void *data) wl_list_remove(&seat->cursor_motion_absolute.link); wl_list_remove(&seat->cursor_button.link); wl_list_remove(&seat->cursor_axis.link); + wl_list_remove(&seat->cursor_frame.link); wl_list_remove(&seat->touch_down.link); wl_list_remove(&seat->touch_up.link); wl_list_remove(&seat->touch_motion.link); @@ -670,6 +680,8 @@ seat_create(struct cg_server *server) wl_signal_add(&seat->cursor->events.button, &seat->cursor_button); seat->cursor_axis.notify = handle_cursor_axis; wl_signal_add(&seat->cursor->events.axis, &seat->cursor_axis); + seat->cursor_frame.notify = handle_cursor_frame; + wl_signal_add(&seat->cursor->events.frame, &seat->cursor_frame); seat->touch_down.notify = handle_touch_down; wl_signal_add(&seat->cursor->events.touch_down, &seat->touch_down); diff --git a/seat.h b/seat.h index 295d9f3..b2839ec 100644 --- a/seat.h +++ b/seat.h @@ -30,6 +30,7 @@ struct cg_seat { struct wl_listener cursor_motion_absolute; struct wl_listener cursor_button; struct wl_listener cursor_axis; + struct wl_listener cursor_frame; int32_t touch_id; double touch_x;