diff options
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/floating.c | 2 | ||||
-rw-r--r-- | sway/commands/focus.c | 2 | ||||
-rw-r--r-- | sway/commands/move.c | 2 | ||||
-rw-r--r-- | sway/commands/scratchpad.c | 9 | ||||
-rw-r--r-- | sway/commands/swap.c | 2 |
5 files changed, 8 insertions, 9 deletions
diff --git a/sway/commands/floating.c b/sway/commands/floating.c index c9467ef0..beafd9fb 100644 --- a/sway/commands/floating.c +++ b/sway/commands/floating.c | |||
@@ -33,7 +33,7 @@ struct cmd_results *cmd_floating(int argc, char **argv) { | |||
33 | // If the container is in a floating split container, | 33 | // If the container is in a floating split container, |
34 | // operate on the split container instead of the child. | 34 | // operate on the split container instead of the child. |
35 | if (container_is_floating_or_child(container)) { | 35 | if (container_is_floating_or_child(container)) { |
36 | while (container->parent->layout != L_FLOATING) { | 36 | while (container->parent->type != C_WORKSPACE) { |
37 | container = container->parent; | 37 | container = container->parent; |
38 | } | 38 | } |
39 | } | 39 | } |
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index fe15b4c7..6659a683 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c | |||
@@ -39,7 +39,7 @@ static struct cmd_results *focus_mode(struct sway_container *con, | |||
39 | // If the container is in a floating split container, | 39 | // If the container is in a floating split container, |
40 | // operate on the split container instead of the child. | 40 | // operate on the split container instead of the child. |
41 | if (container_is_floating_or_child(con)) { | 41 | if (container_is_floating_or_child(con)) { |
42 | while (con->parent->layout != L_FLOATING) { | 42 | while (con->parent->type != C_WORKSPACE) { |
43 | con = con->parent; | 43 | con = con->parent; |
44 | } | 44 | } |
45 | } | 45 | } |
diff --git a/sway/commands/move.c b/sway/commands/move.c index 33d1ee4a..e788d32f 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -449,7 +449,7 @@ static struct cmd_results *move_to_scratchpad(struct sway_container *con) { | |||
449 | // If the container is in a floating split container, | 449 | // If the container is in a floating split container, |
450 | // operate on the split container instead of the child. | 450 | // operate on the split container instead of the child. |
451 | if (container_is_floating_or_child(con)) { | 451 | if (container_is_floating_or_child(con)) { |
452 | while (con->parent->layout != L_FLOATING) { | 452 | while (con->parent->type != C_WORKSPACE) { |
453 | con = con->parent; | 453 | con = con->parent; |
454 | } | 454 | } |
455 | } | 455 | } |
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 | } |
diff --git a/sway/commands/swap.c b/sway/commands/swap.c index 615e6b1d..f881a002 100644 --- a/sway/commands/swap.c +++ b/sway/commands/swap.c | |||
@@ -72,7 +72,7 @@ struct cmd_results *cmd_swap(int argc, char **argv) { | |||
72 | || container_has_ancestor(other, current)) { | 72 | || container_has_ancestor(other, current)) { |
73 | error = cmd_results_new(CMD_FAILURE, "swap", | 73 | error = cmd_results_new(CMD_FAILURE, "swap", |
74 | "Cannot swap ancestor and descendant"); | 74 | "Cannot swap ancestor and descendant"); |
75 | } else if (current->layout == L_FLOATING || other->layout == L_FLOATING) { | 75 | } else if (container_is_floating(current) || container_is_floating(other)) { |
76 | error = cmd_results_new(CMD_FAILURE, "swap", | 76 | error = cmd_results_new(CMD_FAILURE, "swap", |
77 | "Swapping with floating containers is not supported"); | 77 | "Swapping with floating containers is not supported"); |
78 | } | 78 | } |