diff options
Diffstat (limited to 'sway/tree/root.c')
-rw-r--r-- | sway/tree/root.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c index 068e7911..fc908cc1 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c | |||
@@ -82,11 +82,9 @@ void root_scratchpad_remove_container(struct sway_container *con) { | |||
82 | return; | 82 | return; |
83 | } | 83 | } |
84 | con->scratchpad = false; | 84 | con->scratchpad = false; |
85 | for (int i = 0; i < root_container.sway_root->scratchpad->length; ++i) { | 85 | int index = list_find(root_container.sway_root->scratchpad, con); |
86 | if (root_container.sway_root->scratchpad->items[i] == con) { | 86 | if (index != -1) { |
87 | list_del(root_container.sway_root->scratchpad, i); | 87 | list_del(root_container.sway_root->scratchpad, index); |
88 | break; | ||
89 | } | ||
90 | } | 88 | } |
91 | } | 89 | } |
92 | 90 | ||