diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-27 09:14:12 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-28 22:41:04 +1000 |
commit | 9d1f6e095b08252585e6279cd32391a23a877998 (patch) | |
tree | 860fddcc982e44e7f638d2c663f7a49c50f4278d /sway/commands | |
parent | 538e083f61c363ef1127636d8fac1b7e4872e4c4 (diff) |
Send floating container to scratchpad when a child is focused
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/move.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index b127c89f..1aae3838 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -308,6 +308,15 @@ static struct cmd_results *move_to_scratchpad(struct sway_container *con) { con = container_wrap_children(con); workspace->layout = L_HORIZ; } + + // If the container is in a floating split container, + // operate on the split container instead of the child. + if (container_is_floating_or_child(con)) { + while (con->parent->layout != L_FLOATING) { + con = con->parent; + } + } + if (con->scratchpad) { return cmd_results_new(CMD_INVALID, "move", "Container is already in the scratchpad"); |