summaryrefslogtreecommitdiff
path: root/sway/scratchpad.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-07-26 22:42:58 +1000
committerRyan Dwyer <[email protected]>2018-07-28 22:41:04 +1000
commit936168e740067a8658c7097ff76588b070faa71f (patch)
treec16935258c2b040f4a49a236893801bfe9331be2 /sway/scratchpad.c
parent902a1402ba35be3fbc3c054cd7af5a8bda5f8fd6 (diff)
Operate on floating split container when a child is focused
Diffstat (limited to 'sway/scratchpad.c')
-rw-r--r--sway/scratchpad.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/scratchpad.c b/sway/scratchpad.c
index 181d9b3b..787af6e1 100644
--- a/sway/scratchpad.c
+++ b/sway/scratchpad.c
@@ -110,6 +110,15 @@ void scratchpad_toggle_auto(void) {
struct sway_container *ws = focus->type == C_WORKSPACE ?
focus : container_parent(focus, C_WORKSPACE);
+ // If the focus is in a floating split container,
+ // operate on the split container instead of the child.
+ if (container_is_floating_or_child(focus)) {
+ while (focus->parent->layout != L_FLOATING) {
+ focus = focus->parent;
+ }
+ }
+
+
// Check if the currently focused window is a scratchpad window and should
// be hidden again.
if (focus->scratchpad) {