aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-01-27 10:22:06 -0500
committerGitHub <noreply@github.com>2019-01-27 10:22:06 -0500
commit018727b1fc41dcd739ab464c84581c44dd1497ca (patch)
tree31ae7fc75fdabcdc125bb1b3b29260503ea5b96a /rootston
parent89eacf556a64512a4d6ba8241e91f1d287007ad2 (diff)
parentb45fc24b1893484c02420fbb33d7ebb69bbf1eae (diff)
Merge pull request #1503 from emersion/pointer-frame
pointer: add a frame event
Diffstat (limited to 'rootston')
-rw-r--r--rootston/cursor.c4
-rw-r--r--rootston/seat.c11
2 files changed, 15 insertions, 0 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c
index b7ecc813..8ae098de 100644
--- a/rootston/cursor.c
+++ b/rootston/cursor.c
@@ -386,6 +386,10 @@ void roots_cursor_handle_axis(struct roots_cursor *cursor,
event->orientation, event->delta, event->delta_discrete, event->source);
}
+void roots_cursor_handle_frame(struct roots_cursor *cursor) {
+ wlr_seat_pointer_notify_frame(cursor->seat->seat);
+}
+
void roots_cursor_handle_touch_down(struct roots_cursor *cursor,
struct wlr_event_touch_down *event) {
struct roots_desktop *desktop = cursor->seat->input->server->desktop;
diff --git a/rootston/seat.c b/rootston/seat.c
index 43760a5e..c69be8ab 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -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;