summaryrefslogtreecommitdiff
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-07-21 10:40:12 +1000
committerRyan Dwyer <[email protected]>2018-07-22 23:10:19 +1000
commit0c87bff5d1ce686afdc25d37eee4bdd8f08abdd3 (patch)
treeab1b5be08daccc0e92ebff7497687b252fa5f5dc /sway/input/seat.c
parent86f55315113556eaa58f8b06231a89d67b1201ba (diff)
Replace static handle_end_operation with seat_end_mouse_operation
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index cc5b2e0f..3a3350e1 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -932,3 +932,22 @@ void seat_begin_resize(struct sway_seat *seat, struct sway_container *con,
seat->op_ref_width = con->width;
seat->op_ref_height = con->height;
}
+
+void seat_end_mouse_operation(struct sway_seat *seat) {
+ switch (seat->operation) {
+ case OP_MOVE:
+ {
+ // We "move" the container to its own location so it discovers its
+ // output again.
+ struct sway_container *con = seat->op_container;
+ container_floating_move_to(con, con->x, con->y);
+ }
+ case OP_RESIZE:
+ // Don't need to do anything here.
+ break;
+ case OP_NONE:
+ break;
+ }
+ seat->operation = OP_NONE;
+ seat->op_container = NULL;
+}