diff options
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/cursor.c | 6 | ||||
-rw-r--r-- | sway/input/seat.c | 4 | ||||
-rw-r--r-- | sway/input/seatop_down.c | 9 | ||||
-rw-r--r-- | sway/input/seatop_move_floating.c | 2 | ||||
-rw-r--r-- | sway/input/seatop_move_tiling.c | 2 | ||||
-rw-r--r-- | sway/input/seatop_resize_floating.c | 2 | ||||
-rw-r--r-- | sway/input/seatop_resize_tiling.c | 2 |
7 files changed, 14 insertions, 13 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 87811550..44b5ff14 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -606,8 +606,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
606 | // Handle existing seat operation | 606 | // Handle existing seat operation |
607 | if (seat_doing_seatop(seat)) { | 607 | if (seat_doing_seatop(seat)) { |
608 | if (button == seat->seatop_button && state == WLR_BUTTON_RELEASED) { | 608 | if (button == seat->seatop_button && state == WLR_BUTTON_RELEASED) { |
609 | seatop_finish(seat); | 609 | seatop_finish(seat, time_msec); |
610 | seat_pointer_notify_button(seat, time_msec, button, state); | ||
611 | } | 610 | } |
612 | if (state == WLR_BUTTON_PRESSED) { | 611 | if (state == WLR_BUTTON_PRESSED) { |
613 | state_add_button(cursor, button); | 612 | state_add_button(cursor, button); |
@@ -784,8 +783,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
784 | // Handle mousedown on a container surface | 783 | // Handle mousedown on a container surface |
785 | if (surface && cont && state == WLR_BUTTON_PRESSED) { | 784 | if (surface && cont && state == WLR_BUTTON_PRESSED) { |
786 | seat_set_focus_container(seat, cont); | 785 | seat_set_focus_container(seat, cont); |
787 | seat_pointer_notify_button(seat, time_msec, button, state); | 786 | seatop_begin_down(seat, cont, time_msec, button, sx, sy); |
788 | seatop_begin_down(seat, cont, button, sx, sy); | ||
789 | return; | 787 | return; |
790 | } | 788 | } |
791 | 789 | ||
diff --git a/sway/input/seat.c b/sway/input/seat.c index a16d3f27..9888ddfc 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -1211,9 +1211,9 @@ void seatop_motion(struct sway_seat *seat, uint32_t time_msec) { | |||
1211 | } | 1211 | } |
1212 | } | 1212 | } |
1213 | 1213 | ||
1214 | void seatop_finish(struct sway_seat *seat) { | 1214 | void seatop_finish(struct sway_seat *seat, uint32_t time_msec) { |
1215 | if (seat->seatop_impl && seat->seatop_impl->finish) { | 1215 | if (seat->seatop_impl && seat->seatop_impl->finish) { |
1216 | seat->seatop_impl->finish(seat); | 1216 | seat->seatop_impl->finish(seat, time_msec); |
1217 | } | 1217 | } |
1218 | free(seat->seatop_data); | 1218 | free(seat->seatop_data); |
1219 | seat->seatop_data = NULL; | 1219 | seat->seatop_data = NULL; |
diff --git a/sway/input/seatop_down.c b/sway/input/seatop_down.c index c2256c9a..33f9b31a 100644 --- a/sway/input/seatop_down.c +++ b/sway/input/seatop_down.c | |||
@@ -24,7 +24,7 @@ static void handle_motion(struct sway_seat *seat, uint32_t time_msec) { | |||
24 | e->moved = true; | 24 | e->moved = true; |
25 | } | 25 | } |
26 | 26 | ||
27 | static void handle_finish(struct sway_seat *seat) { | 27 | static void handle_finish(struct sway_seat *seat, uint32_t time_msec) { |
28 | struct seatop_down_event *e = seat->seatop_data; | 28 | struct seatop_down_event *e = seat->seatop_data; |
29 | struct sway_cursor *cursor = seat->cursor; | 29 | struct sway_cursor *cursor = seat->cursor; |
30 | // Set the cursor's previous coords to the x/y at the start of the | 30 | // Set the cursor's previous coords to the x/y at the start of the |
@@ -40,6 +40,8 @@ static void handle_finish(struct sway_seat *seat) { | |||
40 | cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); | 40 | cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); |
41 | cursor_send_pointer_motion(cursor, 0, node, surface, sx, sy); | 41 | cursor_send_pointer_motion(cursor, 0, node, surface, sx, sy); |
42 | } | 42 | } |
43 | seat_pointer_notify_button(seat, time_msec, | ||
44 | seat->seatop_button, WLR_BUTTON_RELEASED); | ||
43 | } | 45 | } |
44 | 46 | ||
45 | static void handle_abort(struct sway_seat *seat) { | 47 | static void handle_abort(struct sway_seat *seat) { |
@@ -60,8 +62,8 @@ static const struct sway_seatop_impl seatop_impl = { | |||
60 | .unref = handle_unref, | 62 | .unref = handle_unref, |
61 | }; | 63 | }; |
62 | 64 | ||
63 | void seatop_begin_down(struct sway_seat *seat, | 65 | void seatop_begin_down(struct sway_seat *seat, struct sway_container *con, |
64 | struct sway_container *con, uint32_t button, int sx, int sy) { | 66 | uint32_t time_msec, uint32_t button, int sx, int sy) { |
65 | seatop_abort(seat); | 67 | seatop_abort(seat); |
66 | 68 | ||
67 | struct seatop_down_event *e = | 69 | struct seatop_down_event *e = |
@@ -80,5 +82,6 @@ void seatop_begin_down(struct sway_seat *seat, | |||
80 | seat->seatop_data = e; | 82 | seat->seatop_data = e; |
81 | seat->seatop_button = button; | 83 | seat->seatop_button = button; |
82 | 84 | ||
85 | seat_pointer_notify_button(seat, time_msec, button, WLR_BUTTON_PRESSED); | ||
83 | container_raise_floating(con); | 86 | container_raise_floating(con); |
84 | } | 87 | } |
diff --git a/sway/input/seatop_move_floating.c b/sway/input/seatop_move_floating.c index 08e3a5a4..8a48a968 100644 --- a/sway/input/seatop_move_floating.c +++ b/sway/input/seatop_move_floating.c | |||
@@ -17,7 +17,7 @@ static void handle_motion(struct sway_seat *seat, uint32_t time_msec) { | |||
17 | desktop_damage_whole_container(e->con); | 17 | desktop_damage_whole_container(e->con); |
18 | } | 18 | } |
19 | 19 | ||
20 | static void handle_finish(struct sway_seat *seat) { | 20 | static void handle_finish(struct sway_seat *seat, uint32_t time_msec) { |
21 | struct seatop_move_floating_event *e = seat->seatop_data; | 21 | struct seatop_move_floating_event *e = seat->seatop_data; |
22 | 22 | ||
23 | // We "move" the container to its own location | 23 | // We "move" the container to its own location |
diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c index 1e548f5a..4b5aa81e 100644 --- a/sway/input/seatop_move_tiling.c +++ b/sway/input/seatop_move_tiling.c | |||
@@ -226,7 +226,7 @@ static bool is_parallel(enum sway_container_layout layout, | |||
226 | return layout_is_horiz == edge_is_horiz; | 226 | return layout_is_horiz == edge_is_horiz; |
227 | } | 227 | } |
228 | 228 | ||
229 | static void handle_finish(struct sway_seat *seat) { | 229 | static void handle_finish(struct sway_seat *seat, uint32_t time_msec) { |
230 | struct seatop_move_tiling_event *e = seat->seatop_data; | 230 | struct seatop_move_tiling_event *e = seat->seatop_data; |
231 | 231 | ||
232 | if (!e->target_node) { | 232 | if (!e->target_node) { |
diff --git a/sway/input/seatop_resize_floating.c b/sway/input/seatop_resize_floating.c index 12851b40..bf6c7ab4 100644 --- a/sway/input/seatop_resize_floating.c +++ b/sway/input/seatop_resize_floating.c | |||
@@ -142,7 +142,7 @@ static void handle_motion(struct sway_seat *seat, uint32_t time_msec) { | |||
142 | arrange_container(con); | 142 | arrange_container(con); |
143 | } | 143 | } |
144 | 144 | ||
145 | static void handle_finish(struct sway_seat *seat) { | 145 | static void handle_finish(struct sway_seat *seat, uint32_t time_msec) { |
146 | cursor_set_image(seat->cursor, "left_ptr", NULL); | 146 | cursor_set_image(seat->cursor, "left_ptr", NULL); |
147 | } | 147 | } |
148 | 148 | ||
diff --git a/sway/input/seatop_resize_tiling.c b/sway/input/seatop_resize_tiling.c index cb0f723d..db32065c 100644 --- a/sway/input/seatop_resize_tiling.c +++ b/sway/input/seatop_resize_tiling.c | |||
@@ -49,7 +49,7 @@ static void handle_motion(struct sway_seat *seat, uint32_t time_msec) { | |||
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | static void handle_finish(struct sway_seat *seat) { | 52 | static void handle_finish(struct sway_seat *seat, uint32_t time_msec) { |
53 | cursor_set_image(seat->cursor, "left_ptr", NULL); | 53 | cursor_set_image(seat->cursor, "left_ptr", NULL); |
54 | } | 54 | } |
55 | 55 | ||