diff options
Diffstat (limited to 'sway/input/seatop_resize_tiling.c')
-rw-r--r-- | sway/input/seatop_resize_tiling.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/sway/input/seatop_resize_tiling.c b/sway/input/seatop_resize_tiling.c index 2cca805d..869d11b5 100644 --- a/sway/input/seatop_resize_tiling.c +++ b/sway/input/seatop_resize_tiling.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <wlr/types/wlr_cursor.h> | 2 | #include <wlr/types/wlr_cursor.h> |
3 | #include <wlr/util/edges.h> | 3 | #include <wlr/util/edges.h> |
4 | #include "sway/commands.h" | 4 | #include "sway/commands.h" |
5 | #include "sway/desktop/transaction.h" | ||
5 | #include "sway/input/cursor.h" | 6 | #include "sway/input/cursor.h" |
6 | #include "sway/input/seat.h" | 7 | #include "sway/input/seat.h" |
7 | #include "sway/tree/arrange.h" | 8 | #include "sway/tree/arrange.h" |
@@ -52,21 +53,22 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, | |||
52 | if (e->h_con) { | 53 | if (e->h_con) { |
53 | container_set_resizing(e->h_con, false); | 54 | container_set_resizing(e->h_con, false); |
54 | container_set_resizing(e->h_sib, false); | 55 | container_set_resizing(e->h_sib, false); |
55 | if (e->h_con->parent) { | 56 | if (e->h_con->pending.parent) { |
56 | arrange_container(e->h_con->parent); | 57 | arrange_container(e->h_con->pending.parent); |
57 | } else { | 58 | } else { |
58 | arrange_workspace(e->h_con->workspace); | 59 | arrange_workspace(e->h_con->pending.workspace); |
59 | } | 60 | } |
60 | } | 61 | } |
61 | if (e->v_con) { | 62 | if (e->v_con) { |
62 | container_set_resizing(e->v_con, false); | 63 | container_set_resizing(e->v_con, false); |
63 | container_set_resizing(e->v_sib, false); | 64 | container_set_resizing(e->v_sib, false); |
64 | if (e->v_con->parent) { | 65 | if (e->v_con->pending.parent) { |
65 | arrange_container(e->v_con->parent); | 66 | arrange_container(e->v_con->pending.parent); |
66 | } else { | 67 | } else { |
67 | arrange_workspace(e->v_con->workspace); | 68 | arrange_workspace(e->v_con->pending.workspace); |
68 | } | 69 | } |
69 | } | 70 | } |
71 | transaction_commit_dirty(); | ||
70 | seatop_begin_default(seat); | 72 | seatop_begin_default(seat); |
71 | } | 73 | } |
72 | } | 74 | } |
@@ -80,16 +82,16 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) { | |||
80 | 82 | ||
81 | if (e->h_con) { | 83 | if (e->h_con) { |
82 | if (e->edge & WLR_EDGE_LEFT) { | 84 | if (e->edge & WLR_EDGE_LEFT) { |
83 | amount_x = (e->h_con_orig_width - moved_x) - e->h_con->width; | 85 | amount_x = (e->h_con_orig_width - moved_x) - e->h_con->pending.width; |
84 | } else if (e->edge & WLR_EDGE_RIGHT) { | 86 | } else if (e->edge & WLR_EDGE_RIGHT) { |
85 | amount_x = (e->h_con_orig_width + moved_x) - e->h_con->width; | 87 | amount_x = (e->h_con_orig_width + moved_x) - e->h_con->pending.width; |
86 | } | 88 | } |
87 | } | 89 | } |
88 | if (e->v_con) { | 90 | if (e->v_con) { |
89 | if (e->edge & WLR_EDGE_TOP) { | 91 | if (e->edge & WLR_EDGE_TOP) { |
90 | amount_y = (e->v_con_orig_height - moved_y) - e->v_con->height; | 92 | amount_y = (e->v_con_orig_height - moved_y) - e->v_con->pending.height; |
91 | } else if (e->edge & WLR_EDGE_BOTTOM) { | 93 | } else if (e->edge & WLR_EDGE_BOTTOM) { |
92 | amount_y = (e->v_con_orig_height + moved_y) - e->v_con->height; | 94 | amount_y = (e->v_con_orig_height + moved_y) - e->v_con->pending.height; |
93 | } | 95 | } |
94 | } | 96 | } |
95 | 97 | ||
@@ -99,6 +101,7 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) { | |||
99 | if (amount_y != 0) { | 101 | if (amount_y != 0) { |
100 | container_resize_tiled(e->v_con, e->edge_y, amount_y); | 102 | container_resize_tiled(e->v_con, e->edge_y, amount_y); |
101 | } | 103 | } |
104 | transaction_commit_dirty(); | ||
102 | } | 105 | } |
103 | 106 | ||
104 | static void handle_unref(struct sway_seat *seat, struct sway_container *con) { | 107 | static void handle_unref(struct sway_seat *seat, struct sway_container *con) { |
@@ -140,7 +143,7 @@ void seatop_begin_resize_tiling(struct sway_seat *seat, | |||
140 | if (e->h_con) { | 143 | if (e->h_con) { |
141 | container_set_resizing(e->h_con, true); | 144 | container_set_resizing(e->h_con, true); |
142 | container_set_resizing(e->h_sib, true); | 145 | container_set_resizing(e->h_sib, true); |
143 | e->h_con_orig_width = e->h_con->width; | 146 | e->h_con_orig_width = e->h_con->pending.width; |
144 | } | 147 | } |
145 | } | 148 | } |
146 | if (edge & (WLR_EDGE_TOP | WLR_EDGE_BOTTOM)) { | 149 | if (edge & (WLR_EDGE_TOP | WLR_EDGE_BOTTOM)) { |
@@ -151,12 +154,13 @@ void seatop_begin_resize_tiling(struct sway_seat *seat, | |||
151 | if (e->v_con) { | 154 | if (e->v_con) { |
152 | container_set_resizing(e->v_con, true); | 155 | container_set_resizing(e->v_con, true); |
153 | container_set_resizing(e->v_sib, true); | 156 | container_set_resizing(e->v_sib, true); |
154 | e->v_con_orig_height = e->v_con->height; | 157 | e->v_con_orig_height = e->v_con->pending.height; |
155 | } | 158 | } |
156 | } | 159 | } |
157 | 160 | ||
158 | seat->seatop_impl = &seatop_impl; | 161 | seat->seatop_impl = &seatop_impl; |
159 | seat->seatop_data = e; | 162 | seat->seatop_data = e; |
160 | 163 | ||
164 | transaction_commit_dirty(); | ||
161 | wlr_seat_pointer_notify_clear_focus(seat->wlr_seat); | 165 | wlr_seat_pointer_notify_clear_focus(seat->wlr_seat); |
162 | } | 166 | } |