diff options
Diffstat (limited to 'sway/input/seatop_move_floating.c')
-rw-r--r-- | sway/input/seatop_move_floating.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sway/input/seatop_move_floating.c b/sway/input/seatop_move_floating.c index 7f501fc9..21d048ce 100644 --- a/sway/input/seatop_move_floating.c +++ b/sway/input/seatop_move_floating.c | |||
@@ -1,6 +1,6 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | 1 | #define _POSIX_C_SOURCE 200809L |
2 | #include <wlr/types/wlr_cursor.h> | 2 | #include <wlr/types/wlr_cursor.h> |
3 | #include "sway/desktop.h" | 3 | #include "sway/desktop/transaction.h" |
4 | #include "sway/input/cursor.h" | 4 | #include "sway/input/cursor.h" |
5 | #include "sway/input/seat.h" | 5 | #include "sway/input/seat.h" |
6 | 6 | ||
@@ -14,7 +14,8 @@ static void finalize_move(struct sway_seat *seat) { | |||
14 | 14 | ||
15 | // We "move" the container to its own location | 15 | // We "move" the container to its own location |
16 | // so it discovers its output again. | 16 | // so it discovers its output again. |
17 | container_floating_move_to(e->con, e->con->x, e->con->y); | 17 | container_floating_move_to(e->con, e->con->pending.x, e->con->pending.y); |
18 | transaction_commit_dirty(); | ||
18 | 19 | ||
19 | seatop_begin_default(seat); | 20 | seatop_begin_default(seat); |
20 | } | 21 | } |
@@ -37,9 +38,8 @@ static void handle_tablet_tool_tip(struct sway_seat *seat, | |||
37 | static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) { | 38 | static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) { |
38 | struct seatop_move_floating_event *e = seat->seatop_data; | 39 | struct seatop_move_floating_event *e = seat->seatop_data; |
39 | struct wlr_cursor *cursor = seat->cursor->cursor; | 40 | struct wlr_cursor *cursor = seat->cursor->cursor; |
40 | desktop_damage_whole_container(e->con); | ||
41 | container_floating_move_to(e->con, cursor->x - e->dx, cursor->y - e->dy); | 41 | container_floating_move_to(e->con, cursor->x - e->dx, cursor->y - e->dy); |
42 | desktop_damage_whole_container(e->con); | 42 | transaction_commit_dirty(); |
43 | } | 43 | } |
44 | 44 | ||
45 | static void handle_unref(struct sway_seat *seat, struct sway_container *con) { | 45 | static void handle_unref(struct sway_seat *seat, struct sway_container *con) { |
@@ -67,13 +67,14 @@ void seatop_begin_move_floating(struct sway_seat *seat, | |||
67 | return; | 67 | return; |
68 | } | 68 | } |
69 | e->con = con; | 69 | e->con = con; |
70 | e->dx = cursor->cursor->x - con->x; | 70 | e->dx = cursor->cursor->x - con->pending.x; |
71 | e->dy = cursor->cursor->y - con->y; | 71 | e->dy = cursor->cursor->y - con->pending.y; |
72 | 72 | ||
73 | seat->seatop_impl = &seatop_impl; | 73 | seat->seatop_impl = &seatop_impl; |
74 | seat->seatop_data = e; | 74 | seat->seatop_data = e; |
75 | 75 | ||
76 | container_raise_floating(con); | 76 | container_raise_floating(con); |
77 | transaction_commit_dirty(); | ||
77 | 78 | ||
78 | cursor_set_image(cursor, "grab", NULL); | 79 | cursor_set_image(cursor, "grab", NULL); |
79 | wlr_seat_pointer_notify_clear_focus(seat->wlr_seat); | 80 | wlr_seat_pointer_notify_clear_focus(seat->wlr_seat); |