summaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authoremersion <[email protected]>2018-07-22 19:25:41 +0100
committerGitHub <[email protected]>2018-07-22 19:25:41 +0100
commitbe60e44b7c08b87400fed0b9ea586c449883ba11 (patch)
tree5005c92ed70e19fcd9a316b9a9fad0d3ba07b6ad /sway/tree/container.c
parent27f65b94ae35a7b7342ed331884f765141fad373 (diff)
parentd21d4b83a3effc56b177f5d505aedfdf2ddbbbd5 (diff)
Merge pull request #2296 from RyanDwyer/floating-modifier
Implement floating_modifier and mouse operations for floating views
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 4dbfbb29..42c1d024 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -323,6 +323,8 @@ static struct sway_container *container_destroy_noreaping(
}
}
+ container_end_mouse_operation(con);
+
con->destroying = true;
container_set_dirty(con);
@@ -964,6 +966,8 @@ void container_set_floating(struct sway_container *container, bool enable) {
container_reap_empty_recursive(workspace->sway_workspace->floating);
}
+ container_end_mouse_operation(container);
+
ipc_event_window(container, "floating");
}
@@ -1009,7 +1013,7 @@ void container_get_box(struct sway_container *container, struct wlr_box *box) {
/**
* Translate the container's position as well as all children.
*/
-static void container_floating_translate(struct sway_container *con,
+void container_floating_translate(struct sway_container *con,
double x_amount, double y_amount) {
con->x += x_amount;
con->y += y_amount;
@@ -1105,3 +1109,12 @@ static bool find_urgent_iterator(struct sway_container *con,
bool container_has_urgent_child(struct sway_container *container) {
return container_find(container, find_urgent_iterator, NULL);
}
+
+void container_end_mouse_operation(struct sway_container *container) {
+ struct sway_seat *seat;
+ wl_list_for_each(seat, &input_manager->seats, link) {
+ if (seat->op_container == container) {
+ seat_end_mouse_operation(seat);
+ }
+ }
+}