pointer: add a frame event

Frame events group logically connected pointer events. It makes sense to make
the backend responsible for sending frame events, since once the events are
split (ie. once the frame events are stripped) it's not easy to figure out
which events belongs to which frame again.

This is also how Weston handles frame events.

Fixes https://github.com/swaywm/wlroots/issues/1468
This commit is contained in:
emersion 2019-01-26 11:04:05 +01:00
parent 209210d307
commit 5de26ad8ed
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
14 changed files with 96 additions and 21 deletions

View file

@ -77,6 +77,14 @@ static void handle_cursor_axis(struct wl_listener *listener, void *data) {
roots_cursor_handle_axis(cursor, event);
}
static void handle_cursor_frame(struct wl_listener *listener, void *data) {
struct roots_cursor *cursor =
wl_container_of(listener, cursor, frame);
struct roots_desktop *desktop = cursor->seat->input->server->desktop;
wlr_idle_notify_activity(desktop->idle, cursor->seat->seat);
roots_cursor_handle_frame(cursor);
}
static void handle_switch_toggle(struct wl_listener *listener, void *data) {
struct roots_switch *lid_switch =
wl_container_of(listener, lid_switch, toggle);
@ -443,6 +451,9 @@ static void roots_seat_init_cursor(struct roots_seat *seat) {
wl_signal_add(&wlr_cursor->events.axis, &seat->cursor->axis);
seat->cursor->axis.notify = handle_cursor_axis;
wl_signal_add(&wlr_cursor->events.frame, &seat->cursor->frame);
seat->cursor->frame.notify = handle_cursor_frame;
wl_signal_add(&wlr_cursor->events.touch_down, &seat->cursor->touch_down);
seat->cursor->touch_down.notify = handle_touch_down;