diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2020-02-12 19:46:51 -0500 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-02-13 10:26:14 +0100 |
commit | 7999845357bacac9c7599c899c0d6e88dac0791e (patch) | |
tree | 74d28f8644b2fc71b459c6d6e9656f899ef2dfc0 /sway/commands | |
parent | Apply the output scale filter after the output commit (diff) | |
download | sway-7999845357bacac9c7599c899c0d6e88dac0791e.tar.gz sway-7999845357bacac9c7599c899c0d6e88dac0791e.tar.zst sway-7999845357bacac9c7599c899c0d6e88dac0791e.zip |
cmd_swap: fix test_mark condition
The condition in test_mark was checking the negation of list_seq_find.
This works fine for the first mark, but fails for every other mark. This
fixes the condition to check for anything other than -1, which is the
value returned from list_seq_find for index not found.
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/swap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/commands/swap.c b/sway/commands/swap.c index 697de226..a7f9691b 100644 --- a/sway/commands/swap.c +++ b/sway/commands/swap.c | |||
@@ -202,8 +202,8 @@ static bool test_id(struct sway_container *container, void *data) { | |||
202 | 202 | ||
203 | static bool test_mark(struct sway_container *container, void *mark) { | 203 | static bool test_mark(struct sway_container *container, void *mark) { |
204 | if (container->marks->length) { | 204 | if (container->marks->length) { |
205 | return !list_seq_find(container->marks, | 205 | return list_seq_find(container->marks, |
206 | (int (*)(const void *, const void *))strcmp, mark); | 206 | (int (*)(const void *, const void *))strcmp, mark) != -1; |
207 | } | 207 | } |
208 | return false; | 208 | return false; |
209 | } | 209 | } |