aboutsummaryrefslogtreecommitdiff
path: root/tinywl
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-03-02 11:41:03 +0100
committerDrew DeVault <sir@cmpwn.com>2019-03-02 08:39:41 -0700
commit755a1c9138d82b5184f36d5373dac7cf8fc642da (patch)
treec1f000854b4d18d3096928459b49a198b8af9267 /tinywl
parent2e1dd4ae36fd4fa4c2f86911aaa300833d374619 (diff)
tinywl: send pointer frame events
Fixes https://github.com/swaywm/wlroots/issues/1544
Diffstat (limited to 'tinywl')
-rw-r--r--tinywl/tinywl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c
index 66e00c03..16c1f85c 100644
--- a/tinywl/tinywl.c
+++ b/tinywl/tinywl.c
@@ -45,6 +45,7 @@ struct tinywl_server {
struct wl_listener cursor_motion_absolute;
struct wl_listener cursor_button;
struct wl_listener cursor_axis;
+ struct wl_listener cursor_frame;
struct wlr_seat *seat;
struct wl_listener new_input;
@@ -499,6 +500,17 @@ static void server_cursor_axis(struct wl_listener *listener, void *data) {
event->delta_discrete, event->source);
}
+static void server_cursor_frame(struct wl_listener *listener, void *data) {
+ /* This event is forwarded by the cursor when a pointer emits an frame
+ * event. Frame events are sent after regular pointer events to group
+ * multiple events together. For instance, two axis events may happen at the
+ * same time, in which case a frame event won't be sent in between. */
+ struct tinywl_server *server =
+ wl_container_of(listener, server, cursor_frame);
+ /* Notify the client with pointer focus of the frame event. */
+ wlr_seat_pointer_notify_frame(server->seat);
+}
+
/* Used to move all of the data necessary to render a surface from the top-level
* frame handler to the per-surface render function. */
struct render_data {
@@ -876,6 +888,8 @@ int main(int argc, char *argv[]) {
wl_signal_add(&server.cursor->events.button, &server.cursor_button);
server.cursor_axis.notify = server_cursor_axis;
wl_signal_add(&server.cursor->events.axis, &server.cursor_axis);
+ server.cursor_frame.notify = server_cursor_frame;
+ wl_signal_add(&server.cursor->events.frame, &server.cursor_frame);
/*
* Configures a seat, which is a single "seat" at which a user sits and