diff options
author | emersion <[email protected]> | 2018-08-19 09:21:55 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2018-08-19 09:21:55 +0100 |
commit | 2c91afbb34f649fcd4de690be5bedba4d989a7f0 (patch) | |
tree | 681f45a530a1f8d5966161291c3cb482e52edb6e /sway/commands/scratchpad.c | |
parent | 389d159c81502aa8b951895de11c3720bbd5ba7d (diff) | |
parent | 2b5a404ac920339a2b9ce32d4718272dee4668b9 (diff) |
Merge pull request #2487 from RyanDwyer/workspace-floating-list
Replace hacky L_FLOATING container with a list
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) { // 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) { + while (focus->parent->type != C_WORKSPACE) { focus = focus->parent; } } @@ -33,9 +33,8 @@ static void scratchpad_toggle_auto(void) { // Check if there is an unfocused scratchpad window on the current workspace // and focus it. - for (int i = 0; i < ws->sway_workspace->floating->children->length; ++i) { - struct sway_container *floater = - ws->sway_workspace->floating->children->items[i]; + for (int i = 0; i < ws->sway_workspace->floating->length; ++i) { + struct sway_container *floater = ws->sway_workspace->floating->items[i]; if (floater->scratchpad && focus != floater) { wlr_log(WLR_DEBUG, "Focusing other scratchpad window (%s) in this workspace", @@ -103,7 +102,7 @@ struct cmd_results *cmd_scratchpad(int argc, char **argv) { // If the container is in a floating split container, // operate on the split container instead of the child. if (container_is_floating_or_child(con)) { - while (con->parent->layout != L_FLOATING) { + while (con->parent->type != C_WORKSPACE) { con = con->parent; } } |