diff options
author | 2022-03-14 17:41:40 +0800 | |
---|---|---|
committer | 2022-03-15 11:28:04 +0100 | |
commit | f167acce3a11f342df5fef21679ae4eb8624ae15 (patch) | |
tree | df8c06c31f63e7625939ae397264a2c0d6cdec6f /sway | |
parent | swaybar: set opaque region (diff) | |
download | sway-f167acce3a11f342df5fef21679ae4eb8624ae15.tar.gz sway-f167acce3a11f342df5fef21679ae4eb8624ae15.tar.zst sway-f167acce3a11f342df5fef21679ae4eb8624ae15.zip |
Updating criteria checking with PCRE2
Diffstat (limited to 'sway')
-rw-r--r-- | sway/criteria.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/criteria.c b/sway/criteria.c index 4711a165..94751c5f 100644 --- a/sway/criteria.c +++ b/sway/criteria.c | |||
@@ -161,7 +161,7 @@ static bool criteria_matches_container(struct criteria *criteria, | |||
161 | bool exists = false; | 161 | bool exists = false; |
162 | struct sway_container *con = container; | 162 | struct sway_container *con = container; |
163 | for (int i = 0; i < con->marks->length; ++i) { | 163 | for (int i = 0; i < con->marks->length; ++i) { |
164 | if (regex_cmp(con->marks->items[i], criteria->con_mark->regex) == 0) { | 164 | if (regex_cmp(con->marks->items[i], criteria->con_mark->regex) >= 0) { |
165 | exists = true; | 165 | exists = true; |
166 | break; | 166 | break; |
167 | } | 167 | } |
@@ -199,7 +199,7 @@ static bool criteria_matches_view(struct criteria *criteria, | |||
199 | } | 199 | } |
200 | break; | 200 | break; |
201 | case PATTERN_PCRE2: | 201 | case PATTERN_PCRE2: |
202 | if (regex_cmp(title, criteria->title->regex) != 0) { | 202 | if (regex_cmp(title, criteria->title->regex) < 0) { |
203 | return false; | 203 | return false; |
204 | } | 204 | } |
205 | break; | 205 | break; |
@@ -219,7 +219,7 @@ static bool criteria_matches_view(struct criteria *criteria, | |||
219 | } | 219 | } |
220 | break; | 220 | break; |
221 | case PATTERN_PCRE2: | 221 | case PATTERN_PCRE2: |
222 | if (regex_cmp(shell, criteria->shell->regex) != 0) { | 222 | if (regex_cmp(shell, criteria->shell->regex) < 0) { |
223 | return false; | 223 | return false; |
224 | } | 224 | } |
225 | break; | 225 | break; |
@@ -239,7 +239,7 @@ static bool criteria_matches_view(struct criteria *criteria, | |||
239 | } | 239 | } |
240 | break; | 240 | break; |
241 | case PATTERN_PCRE2: | 241 | case PATTERN_PCRE2: |
242 | if (regex_cmp(app_id, criteria->app_id->regex) != 0) { | 242 | if (regex_cmp(app_id, criteria->app_id->regex) < 0) { |
243 | return false; | 243 | return false; |
244 | } | 244 | } |
245 | break; | 245 | break; |
@@ -271,7 +271,7 @@ static bool criteria_matches_view(struct criteria *criteria, | |||
271 | } | 271 | } |
272 | break; | 272 | break; |
273 | case PATTERN_PCRE2: | 273 | case PATTERN_PCRE2: |
274 | if (regex_cmp(class, criteria->class->regex) != 0) { | 274 | if (regex_cmp(class, criteria->class->regex) < 0) { |
275 | return false; | 275 | return false; |
276 | } | 276 | } |
277 | break; | 277 | break; |
@@ -291,7 +291,7 @@ static bool criteria_matches_view(struct criteria *criteria, | |||
291 | } | 291 | } |
292 | break; | 292 | break; |
293 | case PATTERN_PCRE2: | 293 | case PATTERN_PCRE2: |
294 | if (regex_cmp(instance, criteria->instance->regex) != 0) { | 294 | if (regex_cmp(instance, criteria->instance->regex) < 0) { |
295 | return false; | 295 | return false; |
296 | } | 296 | } |
297 | break; | 297 | break; |
@@ -311,7 +311,7 @@ static bool criteria_matches_view(struct criteria *criteria, | |||
311 | } | 311 | } |
312 | break; | 312 | break; |
313 | case PATTERN_PCRE2: | 313 | case PATTERN_PCRE2: |
314 | if (regex_cmp(window_role, criteria->window_role->regex) != 0) { | 314 | if (regex_cmp(window_role, criteria->window_role->regex) < 0) { |
315 | return false; | 315 | return false; |
316 | } | 316 | } |
317 | break; | 317 | break; |
@@ -370,7 +370,7 @@ static bool criteria_matches_view(struct criteria *criteria, | |||
370 | } | 370 | } |
371 | break; | 371 | break; |
372 | case PATTERN_PCRE2: | 372 | case PATTERN_PCRE2: |
373 | if (regex_cmp(ws->name, criteria->workspace->regex) != 0) { | 373 | if (regex_cmp(ws->name, criteria->workspace->regex) < 0) { |
374 | return false; | 374 | return false; |
375 | } | 375 | } |
376 | break; | 376 | break; |