]> git.sur5r.net Git - i3/i3/blobdiff - src/match.c
Merge branch 'master' into next
[i3/i3] / src / match.c
index 08ec0310e9782ebdc045e0119d7d1678315fe519..de3990fa3f36f1e9f9a533f59181633cd80ece4a 100644 (file)
@@ -1,4 +1,5 @@
-#line 2 "match.c"
+#undef I3__FILE__
+#define I3__FILE__ "match.c"
 /*
  * vim:ts=4:sw=4:expandtab
  *
@@ -46,7 +47,7 @@ bool match_is_empty(Match *match) {
             match->application == NULL &&
             match->class == NULL &&
             match->instance == NULL &&
-            match->role == NULL &&
+            match->window_role == NULL &&
             match->urgent == U_DONTCHECK &&
             match->id == XCB_NONE &&
             match->con_id == NULL &&
@@ -74,7 +75,7 @@ void match_copy(Match *dest, Match *src) {
     DUPLICATE_REGEX(application);
     DUPLICATE_REGEX(class);
     DUPLICATE_REGEX(instance);
-    DUPLICATE_REGEX(role);
+    DUPLICATE_REGEX(window_role);
 }
 
 /*
@@ -112,17 +113,17 @@ bool match_matches_window(Match *match, i3Window *window) {
     }
 
     if (match->title != NULL) {
-        if (window->name_json != NULL &&
-            regex_matches(match->title, window->name_json)) {
-            LOG("title matches (%s)\n", window->name_json);
+        if (window->name != NULL &&
+            regex_matches(match->title, i3string_as_utf8(window->name))) {
+            LOG("title matches (%s)\n", i3string_as_utf8(window->name));
         } else {
             return false;
         }
     }
 
-    if (match->role != NULL) {
+    if (match->window_role != NULL) {
         if (window->role != NULL &&
-            regex_matches(match->role, window->role)) {
+            regex_matches(match->window_role, window->role)) {
             LOG("window_role matches (%s)\n", window->role);
         } else {
             return false;
@@ -195,7 +196,7 @@ void match_free(Match *match) {
     regex_free(match->class);
     regex_free(match->instance);
     regex_free(match->mark);
-    regex_free(match->role);
+    regex_free(match->window_role);
 
     /* Second step: free the regex helper struct itself */
     FREE(match->title);
@@ -203,5 +204,5 @@ void match_free(Match *match) {
     FREE(match->class);
     FREE(match->instance);
     FREE(match->mark);
-    FREE(match->role);
+    FREE(match->window_role);
 }