aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorMarkus Ongyerth <ongy@ongy.net>2018-05-17 09:59:37 +0200
committerMarkus Ongyerth <ongy@ongy.net>2018-07-14 09:47:16 +0200
commitb79d11395c9f8f26287e17e80066fd9034f05266 (patch)
tree52b8c617af7b10d1f33652ac9adaf056bdd12e22 /rootston
parent0c9a26828a764ec2648fa1f72178d5df4dd7b36b (diff)
Hook up set_cursor in rootston
Diffstat (limited to 'rootston')
-rw-r--r--rootston/seat.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/rootston/seat.c b/rootston/seat.c
index 6b12f682..3ca1404e 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -188,6 +188,7 @@ static void handle_tablet_tool_tool_destroy(struct wl_listener *listener, void *
wl_list_remove(&tool->tool_link);
wl_list_remove(&tool->tool_destroy.link);
+ wl_list_remove(&tool->set_cursor.link);
free(tool);
}
@@ -203,6 +204,23 @@ static void handle_tool_button(struct wl_listener *listener, void *data) {
wlr_send_tablet_v2_tablet_tool_button(roots_tool->tablet_v2_tool, event->button, event->state);
}
+static void handle_tablet_tool_set_cursor(struct wl_listener *listener, void *data) {
+ struct roots_tablet_tool_tool *tool =
+ wl_container_of(listener, tool, set_cursor);
+ struct wlr_tablet_v2_event_cursor *evt = data;
+
+
+ struct wlr_seat_pointer_request_set_cursor_event event = {
+ .surface = evt->surface,
+ .hotspot_x = evt->hotspot_x,
+ .hotspot_y = evt->hotspot_y,
+ .serial = evt->serial,
+ .seat_client = evt->seat_client,
+ };
+
+ roots_cursor_handle_request_set_cursor(tool->seat->cursor, &event);
+}
+
static void handle_tool_proximity(struct wl_listener *listener, void *data) {
struct roots_cursor *cursor =
wl_container_of(listener, cursor, tool_proximity);
@@ -221,6 +239,10 @@ static void handle_tool_proximity(struct wl_listener *listener, void *data) {
cursor->seat->seat, tool);
roots_tool->tool_destroy.notify = handle_tablet_tool_tool_destroy;
wl_signal_add(&tool->events.destroy, &roots_tool->tool_destroy);
+
+ roots_tool->set_cursor.notify = handle_tablet_tool_set_cursor;
+ wl_signal_add(&roots_tool->tablet_v2_tool->events.set_cursor, &roots_tool->set_cursor);
+
wl_list_init(&roots_tool->link);
wl_list_init(&roots_tool->tool_link);
}