aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorAlex Maese <memaese@hotmail.com>2018-12-13 23:41:21 -0600
committerAlex Maese <memaese@hotmail.com>2018-12-21 12:20:48 -0600
commit09bdbf24f4fc44cfbb9bd6079a1d7cd08edaefdb (patch)
tree2de113082300840930c7e89af5388e040199d29e /rootston
parentf4cf3c08865e39e88061c96e823b2893a68a433f (diff)
Removed relative pointers from wlr_seat
Diffstat (limited to 'rootston')
-rw-r--r--rootston/cursor.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c
index 4c5fdb36..87f35435 100644
--- a/rootston/cursor.c
+++ b/rootston/cursor.c
@@ -305,12 +305,39 @@ static void roots_cursor_press_button(struct roots_cursor *cursor,
}
}
+static void notify_relative_motion(struct roots_seat *seat, uint64_t time_msec,
+ double dx, double dy, double dx_unaccel, double dy_unaccel) {
+
+ struct wlr_relative_pointer_manager_v1 *relative_pointer_manager =
+ seat->input->server->desktop->relative_pointer_manager;
+
+ struct wlr_seat_client *client = seat->seat->pointer_state.focused_client;
+ if (client == NULL) {
+ return;
+ }
+
+ struct wl_resource *resource;
+ wl_resource_for_each(resource, &relative_pointer_manager->relative_pointers) {
+
+ struct wlr_relative_pointer_v1 *pointer =
+ wlr_relative_pointer_v1_from_resource(resource);
+ if (pointer == NULL) {
+ continue;
+ }
+
+ wlr_relative_pointer_v1_send_relative_motion(pointer, time_msec,
+ dx, dy, dx_unaccel, dy_unaccel);
+ wl_pointer_send_frame(pointer->pointer);
+ }
+
+}
+
void roots_cursor_handle_motion(struct roots_cursor *cursor,
struct wlr_event_pointer_motion *event) {
double dx = event->delta_x;
double dy = event->delta_y;
- wlr_seat_pointer_notify_relative_motion(cursor->seat->seat,
+ notify_relative_motion(cursor->seat,
(uint64_t)event->time_msec * 1000, dx, dy, dx, dy);
if (cursor->active_constraint) {
@@ -354,7 +381,8 @@ void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor,
double dx = lx - cursor->cursor->x;
double dy = ly - cursor->cursor->y;
- wlr_seat_pointer_notify_relative_motion(cursor->seat->seat,
+
+ notify_relative_motion(cursor->seat,
(uint64_t)event->time_msec * 1000, dx, dy, dx, dy);
if (cursor->pointer_view) {