diff options
-rw-r--r-- | include/sway/input/seat.h | 12 | ||||
-rw-r--r-- | sway/input/cursor.c | 4 | ||||
-rw-r--r-- | sway/input/seat.c | 15 | ||||
-rw-r--r-- | sway/input/seatop_default.c | 20 | ||||
-rw-r--r-- | sway/input/seatop_down.c | 8 | ||||
-rw-r--r-- | sway/input/seatop_move_floating.c | 4 | ||||
-rw-r--r-- | sway/input/seatop_move_tiling.c | 5 | ||||
-rw-r--r-- | sway/input/seatop_resize_floating.c | 4 | ||||
-rw-r--r-- | sway/input/seatop_resize_tiling.c | 4 |
9 files changed, 39 insertions, 37 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 1e255b47..2e98a244 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -16,9 +16,10 @@ struct sway_seatop_impl { | |||
16 | void (*button)(struct sway_seat *seat, uint32_t time_msec, | 16 | void (*button)(struct sway_seat *seat, uint32_t time_msec, |
17 | struct wlr_input_device *device, uint32_t button, | 17 | struct wlr_input_device *device, uint32_t button, |
18 | enum wlr_button_state state); | 18 | enum wlr_button_state state); |
19 | void (*motion)(struct sway_seat *seat, uint32_t time_msec, | 19 | void (*pointer_motion)(struct sway_seat *seat, uint32_t time_msec, |
20 | double dx, double dy); | 20 | double dx, double dy); |
21 | void (*axis)(struct sway_seat *seat, struct wlr_event_pointer_axis *event); | 21 | void (*pointer_axis)(struct sway_seat *seat, |
22 | struct wlr_event_pointer_axis *event); | ||
22 | void (*rebase)(struct sway_seat *seat, uint32_t time_msec); | 23 | void (*rebase)(struct sway_seat *seat, uint32_t time_msec); |
23 | void (*tablet_tool_motion)(struct sway_seat *seat, struct sway_tablet *tablet, | 24 | void (*tablet_tool_motion)(struct sway_seat *seat, struct sway_tablet *tablet, |
24 | struct sway_tablet_tool *tool, uint32_t time_msec, double dx, double dy); | 25 | struct sway_tablet_tool *tool, uint32_t time_msec, double dx, double dy); |
@@ -261,15 +262,16 @@ void seatop_button(struct sway_seat *seat, uint32_t time_msec, | |||
261 | /** | 262 | /** |
262 | * dx and dy are distances relative to previous position. | 263 | * dx and dy are distances relative to previous position. |
263 | */ | 264 | */ |
264 | void seatop_motion(struct sway_seat *seat, uint32_t time_msec, | 265 | void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec, |
265 | double dx, double dy); | 266 | double dx, double dy); |
266 | 267 | ||
268 | void seatop_pointer_axis(struct sway_seat *seat, | ||
269 | struct wlr_event_pointer_axis *event); | ||
270 | |||
267 | void seatop_tablet_tool_motion(struct sway_seat *seat, | 271 | void seatop_tablet_tool_motion(struct sway_seat *seat, |
268 | struct sway_tablet *tablet, struct sway_tablet_tool *tool, | 272 | struct sway_tablet *tablet, struct sway_tablet_tool *tool, |
269 | uint32_t time_msec, double dx, double dy); | 273 | uint32_t time_msec, double dx, double dy); |
270 | 274 | ||
271 | void seatop_axis(struct sway_seat *seat, struct wlr_event_pointer_axis *event); | ||
272 | |||
273 | void seatop_rebase(struct sway_seat *seat, uint32_t time_msec); | 275 | void seatop_rebase(struct sway_seat *seat, uint32_t time_msec); |
274 | 276 | ||
275 | /** | 277 | /** |
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index b38b62c8..90ed3b5c 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -321,7 +321,7 @@ static void pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, | |||
321 | 321 | ||
322 | wlr_cursor_move(cursor->cursor, device, dx, dy); | 322 | wlr_cursor_move(cursor->cursor, device, dx, dy); |
323 | 323 | ||
324 | seatop_motion(cursor->seat, time_msec, dx, dy); | 324 | seatop_pointer_motion(cursor->seat, time_msec, dx, dy); |
325 | } | 325 | } |
326 | 326 | ||
327 | static void handle_pointer_motion_relative( | 327 | static void handle_pointer_motion_relative( |
@@ -383,7 +383,7 @@ static void handle_pointer_button(struct wl_listener *listener, void *data) { | |||
383 | 383 | ||
384 | void dispatch_cursor_axis(struct sway_cursor *cursor, | 384 | void dispatch_cursor_axis(struct sway_cursor *cursor, |
385 | struct wlr_event_pointer_axis *event) { | 385 | struct wlr_event_pointer_axis *event) { |
386 | seatop_axis(cursor->seat, event); | 386 | seatop_pointer_axis(cursor->seat, event); |
387 | } | 387 | } |
388 | 388 | ||
389 | static void handle_pointer_axis(struct wl_listener *listener, void *data) { | 389 | static void handle_pointer_axis(struct wl_listener *listener, void *data) { |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 27751c27..4abffb25 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -1449,16 +1449,17 @@ void seatop_button(struct sway_seat *seat, uint32_t time_msec, | |||
1449 | } | 1449 | } |
1450 | } | 1450 | } |
1451 | 1451 | ||
1452 | void seatop_motion(struct sway_seat *seat, uint32_t time_msec, | 1452 | void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec, |
1453 | double dx, double dy) { | 1453 | double dx, double dy) { |
1454 | if (seat->seatop_impl->motion) { | 1454 | if (seat->seatop_impl->pointer_motion) { |
1455 | seat->seatop_impl->motion(seat, time_msec, dx, dy); | 1455 | seat->seatop_impl->pointer_motion(seat, time_msec, dx, dy); |
1456 | } | 1456 | } |
1457 | } | 1457 | } |
1458 | 1458 | ||
1459 | void seatop_axis(struct sway_seat *seat, struct wlr_event_pointer_axis *event) { | 1459 | void seatop_pointer_axis(struct sway_seat *seat, |
1460 | if (seat->seatop_impl->axis) { | 1460 | struct wlr_event_pointer_axis *event) { |
1461 | seat->seatop_impl->axis(seat, event); | 1461 | if (seat->seatop_impl->pointer_axis) { |
1462 | seat->seatop_impl->pointer_axis(seat, event); | ||
1462 | } | 1463 | } |
1463 | } | 1464 | } |
1464 | 1465 | ||
@@ -1468,7 +1469,7 @@ void seatop_tablet_tool_motion(struct sway_seat *seat, | |||
1468 | if (seat->seatop_impl->tablet_tool_motion) { | 1469 | if (seat->seatop_impl->tablet_tool_motion) { |
1469 | seat->seatop_impl->tablet_tool_motion(seat, tablet, tool, time_msec, dx, dy); | 1470 | seat->seatop_impl->tablet_tool_motion(seat, tablet, tool, time_msec, dx, dy); |
1470 | } else { | 1471 | } else { |
1471 | seatop_motion(seat, time_msec, dx, dy); | 1472 | seatop_pointer_motion(seat, time_msec, dx, dy); |
1472 | } | 1473 | } |
1473 | } | 1474 | } |
1474 | 1475 | ||
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c index b7e3ff3f..e0838c04 100644 --- a/sway/input/seatop_default.c +++ b/sway/input/seatop_default.c | |||
@@ -405,9 +405,9 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, | |||
405 | seat_pointer_notify_button(seat, time_msec, button, state); | 405 | seat_pointer_notify_button(seat, time_msec, button, state); |
406 | } | 406 | } |
407 | 407 | ||
408 | /*----------------------------------\ | 408 | /*------------------------------------------\ |
409 | * Functions used by handle_motion / | 409 | * Functions used by handle_pointer_motion / |
410 | *--------------------------------*/ | 410 | *----------------------------------------*/ |
411 | 411 | ||
412 | static void check_focus_follows_mouse(struct sway_seat *seat, | 412 | static void check_focus_follows_mouse(struct sway_seat *seat, |
413 | struct seatop_default_event *e, struct sway_node *hovered_node) { | 413 | struct seatop_default_event *e, struct sway_node *hovered_node) { |
@@ -439,7 +439,7 @@ static void check_focus_follows_mouse(struct sway_seat *seat, | |||
439 | } | 439 | } |
440 | } | 440 | } |
441 | 441 | ||
442 | static void handle_motion(struct sway_seat *seat, uint32_t time_msec, | 442 | static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec, |
443 | double dx, double dy) { | 443 | double dx, double dy) { |
444 | struct seatop_default_event *e = seat->seatop_data; | 444 | struct seatop_default_event *e = seat->seatop_data; |
445 | struct sway_cursor *cursor = seat->cursor; | 445 | struct sway_cursor *cursor = seat->cursor; |
@@ -510,9 +510,9 @@ static void handle_tablet_tool_motion(struct sway_seat *seat, | |||
510 | e->previous_node = node; | 510 | e->previous_node = node; |
511 | } | 511 | } |
512 | 512 | ||
513 | /*--------------------------------\ | 513 | /*----------------------------------------\ |
514 | * Functions used by handle_axis / | 514 | * Functions used by handle_pointer_axis / |
515 | *------------------------------*/ | 515 | *--------------------------------------*/ |
516 | 516 | ||
517 | static uint32_t wl_axis_to_button(struct wlr_event_pointer_axis *event) { | 517 | static uint32_t wl_axis_to_button(struct wlr_event_pointer_axis *event) { |
518 | switch (event->orientation) { | 518 | switch (event->orientation) { |
@@ -526,7 +526,7 @@ static uint32_t wl_axis_to_button(struct wlr_event_pointer_axis *event) { | |||
526 | } | 526 | } |
527 | } | 527 | } |
528 | 528 | ||
529 | static void handle_axis(struct sway_seat *seat, | 529 | static void handle_pointer_axis(struct sway_seat *seat, |
530 | struct wlr_event_pointer_axis *event) { | 530 | struct wlr_event_pointer_axis *event) { |
531 | struct sway_input_device *input_device = | 531 | struct sway_input_device *input_device = |
532 | event->device ? event->device->data : NULL; | 532 | event->device ? event->device->data : NULL; |
@@ -648,8 +648,8 @@ static void handle_rebase(struct sway_seat *seat, uint32_t time_msec) { | |||
648 | 648 | ||
649 | static const struct sway_seatop_impl seatop_impl = { | 649 | static const struct sway_seatop_impl seatop_impl = { |
650 | .button = handle_button, | 650 | .button = handle_button, |
651 | .motion = handle_motion, | 651 | .pointer_motion = handle_pointer_motion, |
652 | .axis = handle_axis, | 652 | .pointer_axis = handle_pointer_axis, |
653 | .tablet_tool_motion = handle_tablet_tool_motion, | 653 | .tablet_tool_motion = handle_tablet_tool_motion, |
654 | .rebase = handle_rebase, | 654 | .rebase = handle_rebase, |
655 | .allow_set_cursor = true, | 655 | .allow_set_cursor = true, |
diff --git a/sway/input/seatop_down.c b/sway/input/seatop_down.c index 04de894d..358d5c59 100644 --- a/sway/input/seatop_down.c +++ b/sway/input/seatop_down.c | |||
@@ -12,7 +12,7 @@ struct seatop_down_event { | |||
12 | double ref_con_lx, ref_con_ly; // container's x/y at start of op | 12 | double ref_con_lx, ref_con_ly; // container's x/y at start of op |
13 | }; | 13 | }; |
14 | 14 | ||
15 | static void handle_axis(struct sway_seat *seat, | 15 | static void handle_pointer_axis(struct sway_seat *seat, |
16 | struct wlr_event_pointer_axis *event) { | 16 | struct wlr_event_pointer_axis *event) { |
17 | struct sway_input_device *input_device = | 17 | struct sway_input_device *input_device = |
18 | event->device ? event->device->data : NULL; | 18 | event->device ? event->device->data : NULL; |
@@ -36,7 +36,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, | |||
36 | } | 36 | } |
37 | } | 37 | } |
38 | 38 | ||
39 | static void handle_motion(struct sway_seat *seat, uint32_t time_msec, | 39 | static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec, |
40 | double dx, double dy) { | 40 | double dx, double dy) { |
41 | struct seatop_down_event *e = seat->seatop_data; | 41 | struct seatop_down_event *e = seat->seatop_data; |
42 | struct sway_container *con = e->con; | 42 | struct sway_container *con = e->con; |
@@ -57,9 +57,9 @@ static void handle_unref(struct sway_seat *seat, struct sway_container *con) { | |||
57 | } | 57 | } |
58 | 58 | ||
59 | static const struct sway_seatop_impl seatop_impl = { | 59 | static const struct sway_seatop_impl seatop_impl = { |
60 | .axis = handle_axis, | ||
61 | .button = handle_button, | 60 | .button = handle_button, |
62 | .motion = handle_motion, | 61 | .pointer_motion = handle_pointer_motion, |
62 | .pointer_axis = handle_pointer_axis, | ||
63 | .unref = handle_unref, | 63 | .unref = handle_unref, |
64 | .allow_set_cursor = true, | 64 | .allow_set_cursor = true, |
65 | }; | 65 | }; |
diff --git a/sway/input/seatop_move_floating.c b/sway/input/seatop_move_floating.c index 672e2d69..a04fd457 100644 --- a/sway/input/seatop_move_floating.c +++ b/sway/input/seatop_move_floating.c | |||
@@ -23,7 +23,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, | |||
23 | } | 23 | } |
24 | } | 24 | } |
25 | 25 | ||
26 | static void handle_motion(struct sway_seat *seat, uint32_t time_msec, | 26 | static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec, |
27 | double dx, double dy) { | 27 | double dx, double dy) { |
28 | struct seatop_move_floating_event *e = seat->seatop_data; | 28 | struct seatop_move_floating_event *e = seat->seatop_data; |
29 | struct wlr_cursor *cursor = seat->cursor->cursor; | 29 | struct wlr_cursor *cursor = seat->cursor->cursor; |
@@ -41,7 +41,7 @@ static void handle_unref(struct sway_seat *seat, struct sway_container *con) { | |||
41 | 41 | ||
42 | static const struct sway_seatop_impl seatop_impl = { | 42 | static const struct sway_seatop_impl seatop_impl = { |
43 | .button = handle_button, | 43 | .button = handle_button, |
44 | .motion = handle_motion, | 44 | .pointer_motion = handle_pointer_motion, |
45 | .unref = handle_unref, | 45 | .unref = handle_unref, |
46 | }; | 46 | }; |
47 | 47 | ||
diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c index 4201ae37..3f31e4b1 100644 --- a/sway/input/seatop_move_tiling.c +++ b/sway/input/seatop_move_tiling.c | |||
@@ -206,7 +206,7 @@ static void handle_motion_postthreshold(struct sway_seat *seat) { | |||
206 | desktop_damage_box(&e->drop_box); | 206 | desktop_damage_box(&e->drop_box); |
207 | } | 207 | } |
208 | 208 | ||
209 | static void handle_motion(struct sway_seat *seat, uint32_t time_msec, | 209 | static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec, |
210 | double dx, double dy) { | 210 | double dx, double dy) { |
211 | struct seatop_move_tiling_event *e = seat->seatop_data; | 211 | struct seatop_move_tiling_event *e = seat->seatop_data; |
212 | if (e->threshold_reached) { | 212 | if (e->threshold_reached) { |
@@ -251,7 +251,6 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, | |||
251 | container_detach(con); | 251 | container_detach(con); |
252 | } | 252 | } |
253 | 253 | ||
254 | |||
255 | // Moving container into empty workspace | 254 | // Moving container into empty workspace |
256 | if (target_node->type == N_WORKSPACE && edge == WLR_EDGE_NONE) { | 255 | if (target_node->type == N_WORKSPACE && edge == WLR_EDGE_NONE) { |
257 | workspace_add_tiling(new_ws, con); | 256 | workspace_add_tiling(new_ws, con); |
@@ -315,7 +314,7 @@ static void handle_unref(struct sway_seat *seat, struct sway_container *con) { | |||
315 | 314 | ||
316 | static const struct sway_seatop_impl seatop_impl = { | 315 | static const struct sway_seatop_impl seatop_impl = { |
317 | .button = handle_button, | 316 | .button = handle_button, |
318 | .motion = handle_motion, | 317 | .pointer_motion = handle_pointer_motion, |
319 | .unref = handle_unref, | 318 | .unref = handle_unref, |
320 | .render = handle_render, | 319 | .render = handle_render, |
321 | }; | 320 | }; |
diff --git a/sway/input/seatop_resize_floating.c b/sway/input/seatop_resize_floating.c index 4e5db112..c9fa1e9b 100644 --- a/sway/input/seatop_resize_floating.c +++ b/sway/input/seatop_resize_floating.c | |||
@@ -25,7 +25,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, | |||
25 | } | 25 | } |
26 | } | 26 | } |
27 | 27 | ||
28 | static void handle_motion(struct sway_seat *seat, uint32_t time_msec, | 28 | static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec, |
29 | double dx, double dy) { | 29 | double dx, double dy) { |
30 | struct seatop_resize_floating_event *e = seat->seatop_data; | 30 | struct seatop_resize_floating_event *e = seat->seatop_data; |
31 | struct sway_container *con = e->con; | 31 | struct sway_container *con = e->con; |
@@ -131,7 +131,7 @@ static void handle_unref(struct sway_seat *seat, struct sway_container *con) { | |||
131 | 131 | ||
132 | static const struct sway_seatop_impl seatop_impl = { | 132 | static const struct sway_seatop_impl seatop_impl = { |
133 | .button = handle_button, | 133 | .button = handle_button, |
134 | .motion = handle_motion, | 134 | .pointer_motion = handle_pointer_motion, |
135 | .unref = handle_unref, | 135 | .unref = handle_unref, |
136 | }; | 136 | }; |
137 | 137 | ||
diff --git a/sway/input/seatop_resize_tiling.c b/sway/input/seatop_resize_tiling.c index 020bba1b..825f5044 100644 --- a/sway/input/seatop_resize_tiling.c +++ b/sway/input/seatop_resize_tiling.c | |||
@@ -27,7 +27,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, | |||
27 | } | 27 | } |
28 | } | 28 | } |
29 | 29 | ||
30 | static void handle_motion(struct sway_seat *seat, uint32_t time_msec, | 30 | static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec, |
31 | double dx, double dy) { | 31 | double dx, double dy) { |
32 | struct seatop_resize_tiling_event *e = seat->seatop_data; | 32 | struct seatop_resize_tiling_event *e = seat->seatop_data; |
33 | int amount_x = 0; | 33 | int amount_x = 0; |
@@ -67,7 +67,7 @@ static void handle_unref(struct sway_seat *seat, struct sway_container *con) { | |||
67 | 67 | ||
68 | static const struct sway_seatop_impl seatop_impl = { | 68 | static const struct sway_seatop_impl seatop_impl = { |
69 | .button = handle_button, | 69 | .button = handle_button, |
70 | .motion = handle_motion, | 70 | .pointer_motion = handle_pointer_motion, |
71 | .unref = handle_unref, | 71 | .unref = handle_unref, |
72 | }; | 72 | }; |
73 | 73 | ||