aboutsummaryrefslogtreecommitdiff
path: root/sway/scratchpad.c
diff options
context:
space:
mode:
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) {