aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c16
-rw-r--r--sway/tree/layout.c1
-rw-r--r--sway/tree/view.c2
3 files changed, 18 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 4dbfbb29..ba4af352 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,13 @@ 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->op_container = NULL;
+ seat->operation = OP_NONE;
+ }
+ }
+}
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 1f898f8a..533906fa 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -562,6 +562,7 @@ void container_move(struct sway_container *container,
workspace_detect_urgent(last_ws);
workspace_detect_urgent(next_ws);
}
+ container_end_mouse_operation(container);
}
enum sway_container_layout container_get_default_layout(
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 7881e6d7..24594950 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -387,6 +387,8 @@ void view_set_fullscreen(struct sway_view *view, bool fullscreen) {
}
}
+ container_end_mouse_operation(view->swayc);
+
ipc_event_window(view->swayc, "fullscreen_mode");
}