aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Tudor Brindus <me@tbrindus.ca>2020-04-25 16:54:29 -0400
committerLibravatar Simon Ser <contact@emersion.fr>2020-05-02 13:32:28 +0200
commit9362003cbaf228247d3f7a44af73c61f532cf893 (patch)
treed3ccab03cab1db3bd93395b7b6e96475f3af4835
parentinput/cursor: make cursor rebasing cursor type-agnostic (diff)
downloadsway-9362003cbaf228247d3f7a44af73c61f532cf893.tar.gz
sway-9362003cbaf228247d3f7a44af73c61f532cf893.tar.zst
sway-9362003cbaf228247d3f7a44af73c61f532cf893.zip
input/cursor: disambiguate cursor functions from pointer functions
-rw-r--r--sway/input/cursor.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index f7a3c54e..1827c744 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -289,7 +289,7 @@ void cursor_unhide(struct sway_cursor *cursor) {
289 cursor_rebase(cursor); 289 cursor_rebase(cursor);
290} 290}
291 291
292static void cursor_motion(struct sway_cursor *cursor, uint32_t time_msec, 292static void pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
293 struct wlr_input_device *device, double dx, double dy, 293 struct wlr_input_device *device, double dx, double dy,
294 double dx_unaccel, double dy_unaccel) { 294 double dx_unaccel, double dy_unaccel) {
295 cursor_handle_activity(cursor, IDLE_SOURCE_POINTER); 295 cursor_handle_activity(cursor, IDLE_SOURCE_POINTER);
@@ -324,17 +324,17 @@ static void cursor_motion(struct sway_cursor *cursor, uint32_t time_msec,
324 seatop_motion(cursor->seat, time_msec, dx, dy); 324 seatop_motion(cursor->seat, time_msec, dx, dy);
325} 325}
326 326
327static void handle_cursor_motion_relative( 327static void handle_pointer_motion_relative(
328 struct wl_listener *listener, void *data) { 328 struct wl_listener *listener, void *data) {
329 struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); 329 struct sway_cursor *cursor = wl_container_of(listener, cursor, motion);
330 struct wlr_event_pointer_motion *e = data; 330 struct wlr_event_pointer_motion *e = data;
331 331
332 cursor_motion(cursor, e->time_msec, e->device, e->delta_x, e->delta_y, 332 pointer_motion(cursor, e->time_msec, e->device, e->delta_x, e->delta_y,
333 e->unaccel_dx, e->unaccel_dy); 333 e->unaccel_dx, e->unaccel_dy);
334 transaction_commit_dirty(); 334 transaction_commit_dirty();
335} 335}
336 336
337static void handle_cursor_motion_absolute( 337static void handle_pointer_motion_absolute(
338 struct wl_listener *listener, void *data) { 338 struct wl_listener *listener, void *data) {
339 struct sway_cursor *cursor = 339 struct sway_cursor *cursor =
340 wl_container_of(listener, cursor, motion_absolute); 340 wl_container_of(listener, cursor, motion_absolute);
@@ -347,7 +347,7 @@ static void handle_cursor_motion_absolute(
347 double dx = lx - cursor->cursor->x; 347 double dx = lx - cursor->cursor->x;
348 double dy = ly - cursor->cursor->y; 348 double dy = ly - cursor->cursor->y;
349 349
350 cursor_motion(cursor, event->time_msec, event->device, dx, dy, dx, dy); 350 pointer_motion(cursor, event->time_msec, event->device, dx, dy, dx, dy);
351 transaction_commit_dirty(); 351 transaction_commit_dirty();
352} 352}
353 353
@@ -361,7 +361,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
361 seatop_button(cursor->seat, time_msec, device, button, state); 361 seatop_button(cursor->seat, time_msec, device, button, state);
362} 362}
363 363
364static void handle_cursor_button(struct wl_listener *listener, void *data) { 364static void handle_pointer_button(struct wl_listener *listener, void *data) {
365 struct sway_cursor *cursor = wl_container_of(listener, cursor, button); 365 struct sway_cursor *cursor = wl_container_of(listener, cursor, button);
366 struct wlr_event_pointer_button *event = data; 366 struct wlr_event_pointer_button *event = data;
367 367
@@ -386,7 +386,7 @@ void dispatch_cursor_axis(struct sway_cursor *cursor,
386 seatop_axis(cursor->seat, event); 386 seatop_axis(cursor->seat, event);
387} 387}
388 388
389static void handle_cursor_axis(struct wl_listener *listener, void *data) { 389static void handle_pointer_axis(struct wl_listener *listener, void *data) {
390 struct sway_cursor *cursor = wl_container_of(listener, cursor, axis); 390 struct sway_cursor *cursor = wl_container_of(listener, cursor, axis);
391 struct wlr_event_pointer_axis *event = data; 391 struct wlr_event_pointer_axis *event = data;
392 cursor_handle_activity(cursor, IDLE_SOURCE_POINTER); 392 cursor_handle_activity(cursor, IDLE_SOURCE_POINTER);
@@ -394,7 +394,7 @@ static void handle_cursor_axis(struct wl_listener *listener, void *data) {
394 transaction_commit_dirty(); 394 transaction_commit_dirty();
395} 395}
396 396
397static void handle_cursor_frame(struct wl_listener *listener, void *data) { 397static void handle_pointer_frame(struct wl_listener *listener, void *data) {
398 struct sway_cursor *cursor = wl_container_of(listener, cursor, frame); 398 struct sway_cursor *cursor = wl_container_of(listener, cursor, frame);
399 cursor_handle_activity(cursor, IDLE_SOURCE_POINTER); 399 cursor_handle_activity(cursor, IDLE_SOURCE_POINTER);
400 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); 400 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
@@ -547,7 +547,7 @@ static void handle_tablet_tool_position(struct sway_cursor *cursor,
547 547
548 if (!surface || !wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) { 548 if (!surface || !wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) {
549 wlr_tablet_v2_tablet_tool_notify_proximity_out(sway_tool->tablet_v2_tool); 549 wlr_tablet_v2_tablet_tool_notify_proximity_out(sway_tool->tablet_v2_tool);
550 cursor_motion(cursor, time_msec, input_device->wlr_device, dx, dy, dx, dy); 550 pointer_motion(cursor, time_msec, input_device->wlr_device, dx, dy, dx, dy);
551 transaction_commit_dirty(); 551 transaction_commit_dirty();
552 return; 552 return;
553 } 553 }
@@ -794,7 +794,7 @@ static void handle_constraint_commit(struct wl_listener *listener,
794 check_constraint_region(cursor); 794 check_constraint_region(cursor);
795} 795}
796 796
797static void handle_request_set_cursor(struct wl_listener *listener, 797static void handle_request_pointer_set_cursor(struct wl_listener *listener,
798 void *data) { 798 void *data) {
799 struct sway_cursor *cursor = 799 struct sway_cursor *cursor =
800 wl_container_of(listener, cursor, request_set_cursor); 800 wl_container_of(listener, cursor, request_set_cursor);
@@ -1011,20 +1011,20 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
1011 1011
1012 // input events 1012 // input events
1013 wl_signal_add(&wlr_cursor->events.motion, &cursor->motion); 1013 wl_signal_add(&wlr_cursor->events.motion, &cursor->motion);
1014 cursor->motion.notify = handle_cursor_motion_relative; 1014 cursor->motion.notify = handle_pointer_motion_relative;
1015 1015
1016 wl_signal_add(&wlr_cursor->events.motion_absolute, 1016 wl_signal_add(&wlr_cursor->events.motion_absolute,
1017 &cursor->motion_absolute); 1017 &cursor->motion_absolute);
1018 cursor->motion_absolute.notify = handle_cursor_motion_absolute; 1018 cursor->motion_absolute.notify = handle_pointer_motion_absolute;
1019 1019
1020 wl_signal_add(&wlr_cursor->events.button, &cursor->button); 1020 wl_signal_add(&wlr_cursor->events.button, &cursor->button);
1021 cursor->button.notify = handle_cursor_button; 1021 cursor->button.notify = handle_pointer_button;
1022 1022
1023 wl_signal_add(&wlr_cursor->events.axis, &cursor->axis); 1023 wl_signal_add(&wlr_cursor->events.axis, &cursor->axis);
1024 cursor->axis.notify = handle_cursor_axis; 1024 cursor->axis.notify = handle_pointer_axis;
1025 1025
1026 wl_signal_add(&wlr_cursor->events.frame, &cursor->frame); 1026 wl_signal_add(&wlr_cursor->events.frame, &cursor->frame);
1027 cursor->frame.notify = handle_cursor_frame; 1027 cursor->frame.notify = handle_pointer_frame;
1028 1028
1029 wl_signal_add(&wlr_cursor->events.touch_down, &cursor->touch_down); 1029 wl_signal_add(&wlr_cursor->events.touch_down, &cursor->touch_down);
1030 cursor->touch_down.notify = handle_touch_down; 1030 cursor->touch_down.notify = handle_touch_down;
@@ -1051,7 +1051,7 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
1051 1051
1052 wl_signal_add(&seat->wlr_seat->events.request_set_cursor, 1052 wl_signal_add(&seat->wlr_seat->events.request_set_cursor,
1053 &cursor->request_set_cursor); 1053 &cursor->request_set_cursor);
1054 cursor->request_set_cursor.notify = handle_request_set_cursor; 1054 cursor->request_set_cursor.notify = handle_request_pointer_set_cursor;
1055 1055
1056 wl_list_init(&cursor->constraint_commit.link); 1056 wl_list_init(&cursor->constraint_commit.link);
1057 wl_list_init(&cursor->tablets); 1057 wl_list_init(&cursor->tablets);