On Mon, Nov 6, 2017 at 4:06 PM, Julien Steinhauser <[email protected]> wrote:
> Hello !
>
Hi
>
> Using cwm and loving it, Thank you Okan and all devs before you
> who got involved in the development. Just minor things
> I'd change from the defaults. Here is one:
>
> When using a menu, I much more often than not hit ^a to list
> all available items, especially when calling kbfunc_menu_client
> and I'm sure I'm not the only one.
>
> The following patch inverts the default behavior, giving instant feedback
> as soon a menu is launched, with all available items being listed.
>
>
So taking away the 'list all' option altogether?
This would be jarring I believe for the 'exec' and 'wm' menus -there's no
reason to list every item in the path :) As you are aware, the button
invocations of the menus default to listing all items, though 'exec' and
'wm' are not available menus via buttons.
However, there might be a balance to apply across the board - right now the
menu will max out at the current region height, maybe we clamp the menus
down to something much less than that, so a full on "list all" by default
isn't too much. Though perhaps a better way is to list-all only when the
height or number of items is some number, maybe by default or not. There
are a lot of ways and I'd prefer to not have a button for each behaviour.
> On the first keystroke, the behavior is back to what it was
> before this patch.
>
> Regards,
> Julien
>
> Index: cwm.1
> ===================================================================
> RCS file: /cvs/xenocara/app/cwm/cwm.1,v
> retrieving revision 1.58
> diff -u -p -r1.58 cwm.1
> --- cwm.1 21 Jul 2017 15:55:37 -0000 1.58
> +++ cwm.1 6 Nov 2017 20:17:14 -0000
> @@ -179,8 +179,6 @@ Previous item.
> Backspace.
> .It Ic C-u
> Clear input.
> -.It Ic C-a
> -List all available items.
> .It Ic [Esc]
> Cancel.
> .El
> Index: menu.c
> ===================================================================
> RCS file: /cvs/xenocara/app/cwm/menu.c,v
> retrieving revision 1.102
> diff -u -p -r1.102 menu.c
> --- menu.c 25 Apr 2017 12:08:05 -0000 1.102
> +++ menu.c 6 Nov 2017 20:17:14 -0000
> @@ -40,7 +40,7 @@
> enum ctltype {
> CTL_NONE = -1,
> CTL_ERASEONE = 0, CTL_WIPE, CTL_UP, CTL_DOWN, CTL_RETURN,
> - CTL_TAB, CTL_ABORT, CTL_ALL
> + CTL_TAB, CTL_ABORT
> };
>
> struct menu_ctx {
> @@ -115,6 +115,7 @@ menu_filter(struct screen_ctx *sc, struc
> evmask |= KEYMASK; /* accept keys as well */
> (void)strlcpy(mc.promptstr, prompt, sizeof(mc.promptstr));
> mc.hasprompt = 1;
> + mc.list = !mc.list; /* List all available items */
> }
>
> XSelectInput(X_Dpy, sc->menu.win, evmask);
> @@ -294,9 +295,6 @@ menu_handle_key(XEvent *e, struct menu_c
> mc->changed = 1;
> }
> break;
> - case CTL_ALL:
> - mc->list = !mc->list;
> - break;
> case CTL_ABORT:
> mi = xmalloc(sizeof(*mi));
> mi->text[0] = '\0';
> @@ -565,10 +563,6 @@ menu_keycode(XKeyEvent *ev, enum ctltype
> case XK_h:
> case XK_H:
> *ctl = CTL_ERASEONE;
> - break;
> - case XK_a:
> - case XK_A:
> - *ctl = CTL_ALL;
> break;
> case XK_bracketleft:
> *ctl = CTL_ABORT;
>
>