summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2016-10-24 17:16:24 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2016-10-24 17:16:24 +0000
commitbcd7dd0844c9991579c101a3a8122715863dca08 (patch)
tree7051f40bd05bf545b70732d12136716d4a49d19c /app/cwm
parent2499e9505731ab9900859c1aab14f0fc183c9468 (diff)
Get rid of 'matchname'; it's too surprising to have the menu change during
client search as different potential str matches are cycled through. If there's interest, the only string that doesn't exist in the listing is the window's class - that can be added of course, but it makes the line too long imho.
Diffstat (limited to 'app/cwm')
-rw-r--r--app/cwm/calmwm.h3
-rw-r--r--app/cwm/search.c16
2 files changed, 5 insertions, 14 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index cf0f0dc64..68e0066b5 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.h,v 1.329 2016/10/18 17:03:30 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.330 2016/10/24 17:16:23 okan Exp $
*/
#ifndef _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/app/cwm/search.c b/app/cwm/search.c
index 29929e16f..9b1bfc13f 100644
--- a/app/cwm/search.c
+++ b/app/cwm/search.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: search.c,v 1.54 2016/10/22 19:16:43 okan Exp $
+ * $OpenBSD: search.c,v 1.55 2016/10/24 17:16:23 okan Exp $
*/
#include <sys/types.h>
@@ -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