diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-26 22:42:58 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-28 22:41:04 +1000 |
commit | 936168e740067a8658c7097ff76588b070faa71f (patch) | |
tree | c16935258c2b040f4a49a236893801bfe9331be2 /sway/commands/floating.c | |
parent | Fix crash when a child of a floating container is in the scratchpad (diff) | |
download | sway-936168e740067a8658c7097ff76588b070faa71f.tar.gz sway-936168e740067a8658c7097ff76588b070faa71f.tar.zst sway-936168e740067a8658c7097ff76588b070faa71f.zip |
Operate on floating split container when a child is focused
Diffstat (limited to 'sway/commands/floating.c')
-rw-r--r-- | sway/commands/floating.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/commands/floating.c b/sway/commands/floating.c index b67e736f..31de5ec3 100644 --- a/sway/commands/floating.c +++ b/sway/commands/floating.c | |||
@@ -29,6 +29,14 @@ struct cmd_results *cmd_floating(int argc, char **argv) { | |||
29 | seat_set_focus(config->handler_context.seat, container); | 29 | seat_set_focus(config->handler_context.seat, container); |
30 | } | 30 | } |
31 | 31 | ||
32 | // If the container is in a floating split container, | ||
33 | // operate on the split container instead of the child. | ||
34 | if (container_is_floating_or_child(container)) { | ||
35 | while (container->parent->layout != L_FLOATING) { | ||
36 | container = container->parent; | ||
37 | } | ||
38 | } | ||
39 | |||
32 | bool wants_floating; | 40 | bool wants_floating; |
33 | if (strcasecmp(argv[0], "enable") == 0) { | 41 | if (strcasecmp(argv[0], "enable") == 0) { |
34 | wants_floating = true; | 42 | wants_floating = true; |