diff options
author | Wynn Wolf Arbor | 2020-03-18 19:46:54 +0100 |
---|---|---|
committer | Wolfgang Müller | 2021-04-27 12:28:35 +0200 |
commit | 08ab650ce0d4d699e7e062d439ab6c8858bad65a (patch) | |
tree | 7ed304e0279bebe1544a140d3dc7d51e70fb42f6 | |
parent | c0f391e648f52cd9b8fa6e534a2f97a8ba0f46a9 (diff) | |
download | cwm-08ab650ce0d4d699e7e062d439ab6c8858bad65a.tar.gz |
Remove matching on window title history
Obscure feature. Confusing if you don't know about it, mostly useless if
you do. Matching on currently visible window titles is enough.
-rw-r--r-- | calmwm.h | 3 | ||||
-rw-r--r-- | client.c | 31 | ||||
-rw-r--r-- | conf.c | 1 | ||||
-rw-r--r-- | cwm.1 | 4 | ||||
-rw-r--r-- | search.c | 8 |
5 files changed, 3 insertions, 44 deletions
@@ -130,7 +130,6 @@ struct winname { TAILQ_ENTRY(winname) entry; char *name; }; -TAILQ_HEAD(name_q, winname); TAILQ_HEAD(ignore_q, winname); struct client_ctx { @@ -187,7 +186,6 @@ struct client_ctx { #define CLIENT_MAXIMIZED (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED) int flags; int stackingorder; - struct name_q nameq; char *name; char *label; char *res_class; /* class hint */ @@ -307,7 +305,6 @@ struct conf { struct wm_q wmq; int ngroups; int stickygroups; - int nameqlen; int bwidth; int mamount; int snapdist; @@ -73,7 +73,6 @@ client_init(Window win, struct screen_ctx *sc) cc->stackingorder = 0; cc->initial_state = 0; memset(&cc->hint, 0, sizeof(cc->hint)); - TAILQ_INIT(&cc->nameq); cc->geom.x = wattr.x; cc->geom.y = wattr.y; @@ -209,7 +208,6 @@ void client_remove(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - struct winname *wn; TAILQ_REMOVE(&sc->clientq, cc, entry); @@ -219,12 +217,6 @@ client_remove(struct client_ctx *cc) if (cc->flags & CLIENT_ACTIVE) xu_ewmh_net_active_window(sc, None); - while ((wn = TAILQ_FIRST(&cc->nameq)) != NULL) { - TAILQ_REMOVE(&cc->nameq, wn, entry); - free(wn->name); - free(wn); - } - free(cc->name); free(cc->label); free(cc->res_class); @@ -661,33 +653,10 @@ client_close(struct client_ctx *cc) void client_set_name(struct client_ctx *cc) { - struct winname *wn, *wnnxt; - int i = 0; - free(cc->name); if (!xu_get_strprop(cc->win, ewmh[_NET_WM_NAME], &cc->name)) if (!xu_get_strprop(cc->win, XA_WM_NAME, &cc->name)) cc->name = xstrdup(""); - - TAILQ_FOREACH_SAFE(wn, &cc->nameq, entry, wnnxt) { - if (strcmp(wn->name, cc->name) == 0) { - TAILQ_REMOVE(&cc->nameq, wn, entry); - free(wn->name); - free(wn); - } - i++; - } - wn = xmalloc(sizeof(*wn)); - wn->name = xstrdup(cc->name); - TAILQ_INSERT_TAIL(&cc->nameq, wn, entry); - - /* Garbage collection. */ - if ((i + 1) > Conf.nameqlen) { - wn = TAILQ_FIRST(&cc->nameq); - TAILQ_REMOVE(&cc->nameq, wn, entry); - free(wn->name); - free(wn); - } } static void @@ -281,7 +281,6 @@ conf_init(struct conf *c) c->vtile = 50; c->snapdist = 0; c->ngroups = 0; - c->nameqlen = 5; TAILQ_INIT(&c->ignoreq); TAILQ_INIT(&c->autogroupq); @@ -193,9 +193,7 @@ function. features the ability to search for windows by their current title, old titles, and by their label. The priority for the search results are: label, current title, -old titles in reverse order, and finally window class name. -.Nm -keeps a history of the 5 previous titles of a window. +and window class name. .Pp When searching, the leftmost character of the result list may show a flag: @@ -71,7 +71,6 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search) { struct menu *mi, *tierp[3], *before = NULL; struct client_ctx *cc; - struct winname *wn; (void)memset(tierp, 0, sizeof(tierp)); @@ -86,11 +85,8 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search) /* Match on window name history, from present to past. */ if (tier < 0) { - TAILQ_FOREACH_REVERSE(wn, &cc->nameq, name_q, entry) - if (match_substr(search, wn->name, 0)) { - tier = 1; - break; - } + if (match_substr(search, cc->name, 0)) + tier = 1; } /* Match on window resource class. */ |