diff options
author | okan <okan> | 2017-04-25 13:40:33 +0000 |
---|---|---|
committer | okan <okan> | 2017-04-25 13:40:33 +0000 |
commit | 2d9185129bbf40029ae35cbdc9667e1c777593fe (patch) | |
tree | 4f89c96f6bbf84c6f140f2aac24ddafb63023a15 /menu.c | |
parent | ab8da6180277713fd99be23ceb341f5ce3a75522 (diff) | |
parent | 15b9a8fe27a72e58f1fb488ebf14c3fcae4b98a9 (diff) | |
download | cwm-2d9185129bbf40029ae35cbdc9667e1c777593fe.tar.gz cwm-2d9185129bbf40029ae35cbdc9667e1c777593fe.tar.xz cwm-2d9185129bbf40029ae35cbdc9667e1c777593fe.zip |
cvsimport
* refs/heads/master: The r1.36 menuq_add() conversion did this one wrong; fix by reverting to the original code which adds to resultentry list, as opposed to the wrong one in menuq_add(). Fixes crash noticed by at least Rickard Gustafsson. Remove 'noresult' (and simplify) as it does nothing and makes the logic around it needless. History doesn't show what this might have been used for in future iterations. search_match_path() isn't supposed to return anything. Move queue init to caller so it's only called once in a few cases. sort Raise the previously focused window, instead of the previous window in the cycle list; seems to match behaviour of other wm's; from Walter Alejandro Iglesias. For {h,v}tile, instead of keeping the master client's {h,v} geometry, expand it to %50 of the area, then fill in the remaining space with the other clients in the same group; from Gerrit Meyerheim.
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/menu.c b/menu.c index af13cbf..d3db032 100644 --- a/menu.c +++ b/menu.c @@ -52,7 +52,6 @@ struct menu_ctx { int list; int listing; int changed; - int noresult; int prev; int entry; int num; @@ -313,15 +312,10 @@ menu_handle_key(XEvent *e, struct menu_ctx *mc, struct menu_q *menuq, (void)strlcat(mc->searchstr, chr, sizeof(mc->searchstr)); } - mc->noresult = 0; - if (mc->changed && mc->searchstr[0] != '\0') { - (*mc->match)(menuq, resultq, mc->searchstr); - /* If menuq is empty, never show we've failed */ - mc->noresult = TAILQ_EMPTY(resultq) && !TAILQ_EMPTY(menuq); - } else if (mc->changed) - TAILQ_INIT(resultq); - - if (!mc->list && mc->listing && !mc->changed) { + if (mc->changed) { + if (mc->searchstr[0] != '\0') + (*mc->match)(menuq, resultq, mc->searchstr); + } else if (!mc->list && mc->listing) { TAILQ_INIT(resultq); mc->listing = 0; } |