aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-07-26 22:58:42 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-07-28 22:41:04 +1000
commitda2a87f6c71bfe90a4d77542bfc7ed22899f67be (patch)
tree76cb0dcdd9006bbec11321645e096ea47cd79e82 /sway/tree
parent936168e740067a8658c7097ff76588b070faa71f (diff)
downloadsway-da2a87f6c71bfe90a4d77542bfc7ed22899f67be.tar.xz
When unfloating, return container to previously focused tiled container
This introduces seat_get_focus_inactive_tiling and updates `focus mode_toggle` to use it instead, because the previous method wasn't guaranteed to return a tiling view.
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 566432b1..b8ff87e1 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1015,6 +1015,7 @@ void container_set_floating(struct sway_container *container, bool enable) {
return;
}
+ struct sway_seat *seat = input_manager_current_seat(input_manager);
struct sway_container *workspace = container_parent(container, C_WORKSPACE);
if (enable) {
@@ -1029,8 +1030,10 @@ void container_set_floating(struct sway_container *container, bool enable) {
if (container->scratchpad) {
scratchpad_remove_container(container);
}
+ struct sway_container *sibling =
+ seat_get_focus_inactive_tiling(seat, workspace);
container_remove_child(container);
- container_add_child(workspace, container);
+ container_add_child(sibling, container);
container->width = container->parent->width;
container->height = container->parent->height;
if (container->type == C_VIEW) {