diff options
Diffstat (limited to 'sway/commands/scratchpad.c')
-rw-r--r-- | sway/commands/scratchpad.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sway/commands/scratchpad.c b/sway/commands/scratchpad.c index 0e573aeb..7da20015 100644 --- a/sway/commands/scratchpad.c +++ b/sway/commands/scratchpad.c | |||
@@ -16,7 +16,7 @@ static void scratchpad_toggle_auto(void) { | |||
16 | // If the focus is in a floating split container, | 16 | // If the focus is in a floating split container, |
17 | // operate on the split container instead of the child. | 17 | // operate on the split container instead of the child. |
18 | if (container_is_floating_or_child(focus)) { | 18 | if (container_is_floating_or_child(focus)) { |
19 | while (focus->parent->layout != L_FLOATING) { | 19 | while (focus->parent->type != C_WORKSPACE) { |
20 | focus = focus->parent; | 20 | focus = focus->parent; |
21 | } | 21 | } |
22 | } | 22 | } |
@@ -33,9 +33,8 @@ static void scratchpad_toggle_auto(void) { | |||
33 | 33 | ||
34 | // Check if there is an unfocused scratchpad window on the current workspace | 34 | // Check if there is an unfocused scratchpad window on the current workspace |
35 | // and focus it. | 35 | // and focus it. |
36 | for (int i = 0; i < ws->sway_workspace->floating->children->length; ++i) { | 36 | for (int i = 0; i < ws->sway_workspace->floating->length; ++i) { |
37 | struct sway_container *floater = | 37 | struct sway_container *floater = ws->sway_workspace->floating->items[i]; |
38 | ws->sway_workspace->floating->children->items[i]; | ||
39 | if (floater->scratchpad && focus != floater) { | 38 | if (floater->scratchpad && focus != floater) { |
40 | wlr_log(WLR_DEBUG, | 39 | wlr_log(WLR_DEBUG, |
41 | "Focusing other scratchpad window (%s) in this workspace", | 40 | "Focusing other scratchpad window (%s) in this workspace", |
@@ -103,7 +102,7 @@ struct cmd_results *cmd_scratchpad(int argc, char **argv) { | |||
103 | // If the container is in a floating split container, | 102 | // If the container is in a floating split container, |
104 | // operate on the split container instead of the child. | 103 | // operate on the split container instead of the child. |
105 | if (container_is_floating_or_child(con)) { | 104 | if (container_is_floating_or_child(con)) { |
106 | while (con->parent->layout != L_FLOATING) { | 105 | while (con->parent->type != C_WORKSPACE) { |
107 | con = con->parent; | 106 | con = con->parent; |
108 | } | 107 | } |
109 | } | 108 | } |