mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
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.
This commit is contained in:
parent
b1af1bedd0
commit
ffd60b3cab
1
calmwm.h
1
calmwm.h
@ -165,7 +165,6 @@ struct client_ctx {
|
|||||||
struct name_q nameq;
|
struct name_q nameq;
|
||||||
char *name;
|
char *name;
|
||||||
char *label;
|
char *label;
|
||||||
char *matchname;
|
|
||||||
XClassHint ch;
|
XClassHint ch;
|
||||||
XWMHints *wmh;
|
XWMHints *wmh;
|
||||||
};
|
};
|
||||||
|
14
search.c
14
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;
|
struct client_ctx *cc = (struct client_ctx *)mi->ctx;
|
||||||
|
|
||||||
/* Match on label. */
|
/* Match on label. */
|
||||||
if ((cc->label) && strsubmatch(search, cc->label, 0)) {
|
if ((cc->label) && strsubmatch(search, cc->label, 0))
|
||||||
cc->matchname = cc->label;
|
|
||||||
tier = 0;
|
tier = 0;
|
||||||
}
|
|
||||||
|
|
||||||
/* Match on window name history, from present to past. */
|
/* Match on window name history, from present to past. */
|
||||||
if (tier < 0) {
|
if (tier < 0) {
|
||||||
TAILQ_FOREACH_REVERSE(wn, &cc->nameq, name_q, entry)
|
TAILQ_FOREACH_REVERSE(wn, &cc->nameq, name_q, entry)
|
||||||
if (strsubmatch(search, wn->name, 0)) {
|
if (strsubmatch(search, wn->name, 0)) {
|
||||||
cc->matchname = wn->name;
|
|
||||||
tier = 2;
|
tier = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Match on window class name. */
|
/* Match on window class name. */
|
||||||
if ((tier < 0) && strsubmatch(search, cc->ch.res_class, 0)) {
|
if ((tier < 0) && strsubmatch(search, cc->ch.res_class, 0))
|
||||||
cc->matchname = cc->ch.res_class;
|
|
||||||
tier = 3;
|
tier = 3;
|
||||||
}
|
|
||||||
|
|
||||||
if (tier < 0)
|
if (tier < 0)
|
||||||
continue;
|
continue;
|
||||||
@ -140,12 +135,9 @@ search_print_client(struct menu *mi, int list)
|
|||||||
else if (cc->flags & CLIENT_HIDDEN)
|
else if (cc->flags & CLIENT_HIDDEN)
|
||||||
flag = '&';
|
flag = '&';
|
||||||
|
|
||||||
if ((list) || (cc->matchname == cc->label))
|
|
||||||
cc->matchname = cc->name;
|
|
||||||
|
|
||||||
(void)snprintf(mi->print, sizeof(mi->print), "(%d) %c[%s] %s",
|
(void)snprintf(mi->print, sizeof(mi->print), "(%d) %c[%s] %s",
|
||||||
(cc->gc) ? cc->gc->num : 0, flag,
|
(cc->gc) ? cc->gc->num : 0, flag,
|
||||||
(cc->label) ? cc->label : "", cc->matchname);
|
(cc->label) ? cc->label : "", cc->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user