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 | |
parent | Fix focus mode_toggle from a child of a floating container (diff) | |
download | sway-9d1f6e095b08252585e6279cd32391a23a877998.tar.gz sway-9d1f6e095b08252585e6279cd32391a23a877998.tar.zst sway-9d1f6e095b08252585e6279cd32391a23a877998.zip |
Send floating container to scratchpad when a child is focused
Diffstat (limited to 'sway')
-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) { | |||
308 | con = container_wrap_children(con); | 308 | con = container_wrap_children(con); |
309 | workspace->layout = L_HORIZ; | 309 | workspace->layout = L_HORIZ; |
310 | } | 310 | } |
311 | |||
312 | // If the container is in a floating split container, | ||
313 | // operate on the split container instead of the child. | ||
314 | if (container_is_floating_or_child(con)) { | ||
315 | while (con->parent->layout != L_FLOATING) { | ||
316 | con = con->parent; | ||
317 | } | ||
318 | } | ||
319 | |||
311 | if (con->scratchpad) { | 320 | if (con->scratchpad) { |
312 | return cmd_results_new(CMD_INVALID, "move", | 321 | return cmd_results_new(CMD_INVALID, "move", |
313 | "Container is already in the scratchpad"); | 322 | "Container is already in the scratchpad"); |