summaryrefslogtreecommitdiff
path: root/sway/criteria.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-05-14 22:47:10 +1000
committerRyan Dwyer <[email protected]>2018-05-15 11:18:27 +1000
commit22d38600d0edbb35029b3076c14e0e119dbf3dd2 (patch)
treead548731ca215e2ec0f56cde86a6ff16df8cb323 /sway/criteria.c
parentf1f54bbc882775d431d14f99355d339ef9dab5a8 (diff)
Implement marks
Diffstat (limited to 'sway/criteria.c')
-rw-r--r--sway/criteria.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sway/criteria.c b/sway/criteria.c
index 248260ec..4295cacc 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -75,8 +75,16 @@ static bool criteria_matches_view(struct criteria *criteria,
}
if (criteria->con_mark) {
- // TODO
- return false;
+ bool exists = false;
+ for (int i = 0; i < view->marks->length; ++i) {
+ if (regex_cmp(view->marks->items[i], criteria->con_mark) == 0) {
+ exists = true;
+ break;
+ }
+ }
+ if (!exists) {
+ return false;
+ }
}
if (criteria->con_id) { // Internal ID