summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--calmwm.h1
-rw-r--r--search.c14
2 files changed, 3 insertions, 12 deletions
diff --git a/calmwm.h b/calmwm.h
index f6542a7..d44df66 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -165,7 +165,6 @@ struct client_ctx {
 	struct name_q		 nameq;
 	char			*name;
 	char			*label;
-	char			*matchname;
 	XClassHint		ch;
 	XWMHints		*wmh;
 };
diff --git a/search.c b/search.c
index 0c57b49..9ca4e5d 100644
--- a/search.c
+++ b/search.c
@@ -57,26 +57,21 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
 		struct client_ctx *cc = (struct client_ctx *)mi->ctx;
 
 		/* Match on label. */
-		if ((cc->label) && strsubmatch(search, cc->label, 0)) {
-			cc->matchname = cc->label;
+		if ((cc->label) && strsubmatch(search, cc->label, 0))
 			tier = 0;
-		}
 
 		/* Match on window name history, from present to past. */
 		if (tier < 0) {
 			TAILQ_FOREACH_REVERSE(wn, &cc->nameq, name_q, entry)
 				if (strsubmatch(search, wn->name, 0)) {
-					cc->matchname = wn->name;
 					tier = 2;
 					break;
 				}
 		}
 
 		/* Match on window class name. */
-		if ((tier < 0) && strsubmatch(search, cc->ch.res_class, 0)) {
-			cc->matchname = cc->ch.res_class;
+		if ((tier < 0) && strsubmatch(search, cc->ch.res_class, 0))
 			tier = 3;
-		}
 
 		if (tier < 0)
 			continue;
@@ -140,12 +135,9 @@ search_print_client(struct menu *mi, int list)
 	else if (cc->flags & CLIENT_HIDDEN)
 		flag = '&';
 
-	if ((list) || (cc->matchname == cc->label))
-		cc->matchname = cc->name;
-
 	(void)snprintf(mi->print, sizeof(mi->print), "(%d) %c[%s] %s",
 	    (cc->gc) ? cc->gc->num : 0, flag,
-	    (cc->label) ? cc->label : "", cc->matchname);
+	    (cc->label) ? cc->label : "", cc->name);
 }
 
 static void