aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-01-13 20:38:34 -0500
committerGitHub <noreply@github.com>2019-01-13 20:38:34 -0500
commit23ab56bbf746e7aa4a940caa343d447a969fa37e (patch)
tree087201fd4d39c3a551c925c4f5479311e10e6623 /sway/tree/container.c
parent08569aab36837bf1a43c9c7c8445aa13dc78a814 (diff)
parented5aafd90bd850ad27dcb36ac4438ed926480394 (diff)
downloadsway-23ab56bbf746e7aa4a940caa343d447a969fa37e.tar.xz
Merge pull request #3402 from RyanDwyer/refactor-seatops
Refactor seat operations to use an interface
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 99262356..d9c721f5 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -864,15 +864,7 @@ bool container_has_urgent_child(struct sway_container *container) {
void container_end_mouse_operation(struct sway_container *container) {
struct sway_seat *seat;
wl_list_for_each(seat, &server.input->seats, link) {
- if (seat->op_container == container) {
- seat->op_target_node = NULL; // ensure tiling move doesn't apply
- seat_end_mouse_operation(seat);
- }
- // If the user is doing a tiling drag over this container,
- // keep the operation active but unset the target container.
- if (seat->op_target_node == &container->node) {
- seat->op_target_node = NULL;
- }
+ seatop_unref(seat, container);
}
}
@@ -1384,3 +1376,16 @@ void container_update_marks_textures(struct sway_container *con) {
&config->border_colors.urgent);
container_damage_whole(con);
}
+
+void container_raise_floating(struct sway_container *con) {
+ // Bring container to front by putting it at the end of the floating list.
+ struct sway_container *floater = con;
+ while (floater->parent) {
+ floater = floater->parent;
+ }
+ if (container_is_floating(floater)) {
+ list_move_to_end(floater->workspace->floating, floater);
+ node_set_dirty(&floater->workspace->node);
+ }
+}
+