mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
seat: listen on the wlr_cursor.frame event
This is now required with wlroots 0.3, see https://github.com/swaywm/wlroots/releases/tag/0.3 and https://github.com/swaywm/wlroots/pull/1503.
This commit is contained in:
parent
9d825d6dc7
commit
202f74f21a
2 changed files with 13 additions and 0 deletions
12
seat.c
12
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);
|
||||
|
|
|
|||
1
seat.h
1
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue