aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seatop_resize_floating.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/seatop_resize_floating.c')
-rw-r--r--sway/input/seatop_resize_floating.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/sway/input/seatop_resize_floating.c b/sway/input/seatop_resize_floating.c
index 5da22e47..8400a4b3 100644
--- a/sway/input/seatop_resize_floating.c
+++ b/sway/input/seatop_resize_floating.c
@@ -2,6 +2,7 @@
2#include <limits.h> 2#include <limits.h>
3#include <wlr/types/wlr_cursor.h> 3#include <wlr/types/wlr_cursor.h>
4#include <wlr/types/wlr_xcursor_manager.h> 4#include <wlr/types/wlr_xcursor_manager.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"
@@ -27,6 +28,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
27 if (seat->cursor->pressed_button_count == 0) { 28 if (seat->cursor->pressed_button_count == 0) {
28 container_set_resizing(con, false); 29 container_set_resizing(con, false);
29 arrange_container(con); // Send configure w/o resizing hint 30 arrange_container(con); // Send configure w/o resizing hint
31 transaction_commit_dirty();
30 seatop_begin_default(seat); 32 seatop_begin_default(seat);
31 } 33 }
32} 34}
@@ -116,23 +118,24 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) {
116 118
117 // Determine the amounts we need to bump everything relative to the current 119 // Determine the amounts we need to bump everything relative to the current
118 // size. 120 // size.
119 int relative_grow_width = width - con->width; 121 int relative_grow_width = width - con->pending.width;
120 int relative_grow_height = height - con->height; 122 int relative_grow_height = height - con->pending.height;
121 int relative_grow_x = (e->ref_con_lx + grow_x) - con->x; 123 int relative_grow_x = (e->ref_con_lx + grow_x) - con->pending.x;
122 int relative_grow_y = (e->ref_con_ly + grow_y) - con->y; 124 int relative_grow_y = (e->ref_con_ly + grow_y) - con->pending.y;
123 125
124 // Actually resize stuff 126 // Actually resize stuff
125 con->x += relative_grow_x; 127 con->pending.x += relative_grow_x;
126 con->y += relative_grow_y; 128 con->pending.y += relative_grow_y;
127 con->width += relative_grow_width; 129 con->pending.width += relative_grow_width;
128 con->height += relative_grow_height; 130 con->pending.height += relative_grow_height;
129 131
130 con->content_x += relative_grow_x; 132 con->pending.content_x += relative_grow_x;
131 con->content_y += relative_grow_y; 133 con->pending.content_y += relative_grow_y;
132 con->content_width += relative_grow_width; 134 con->pending.content_width += relative_grow_width;
133 con->content_height += relative_grow_height; 135 con->pending.content_height += relative_grow_height;
134 136
135 arrange_container(con); 137 arrange_container(con);
138 transaction_commit_dirty();
136} 139}
137 140
138static void handle_unref(struct sway_seat *seat, struct sway_container *con) { 141static void handle_unref(struct sway_seat *seat, struct sway_container *con) {
@@ -166,16 +169,17 @@ void seatop_begin_resize_floating(struct sway_seat *seat,
166 e->edge = edge == WLR_EDGE_NONE ? WLR_EDGE_BOTTOM | WLR_EDGE_RIGHT : edge; 169 e->edge = edge == WLR_EDGE_NONE ? WLR_EDGE_BOTTOM | WLR_EDGE_RIGHT : edge;
167 e->ref_lx = seat->cursor->cursor->x; 170 e->ref_lx = seat->cursor->cursor->x;
168 e->ref_ly = seat->cursor->cursor->y; 171 e->ref_ly = seat->cursor->cursor->y;
169 e->ref_con_lx = con->x; 172 e->ref_con_lx = con->pending.x;
170 e->ref_con_ly = con->y; 173 e->ref_con_ly = con->pending.y;
171 e->ref_width = con->width; 174 e->ref_width = con->pending.width;
172 e->ref_height = con->height; 175 e->ref_height = con->pending.height;
173 176
174 seat->seatop_impl = &seatop_impl; 177 seat->seatop_impl = &seatop_impl;
175 seat->seatop_data = e; 178 seat->seatop_data = e;
176 179
177 container_set_resizing(con, true); 180 container_set_resizing(con, true);
178 container_raise_floating(con); 181 container_raise_floating(con);
182 transaction_commit_dirty();
179 183
180 const char *image = edge == WLR_EDGE_NONE ? 184 const char *image = edge == WLR_EDGE_NONE ?
181 "se-resize" : wlr_xcursor_get_resize_name(edge); 185 "se-resize" : wlr_xcursor_get_resize_name(edge);