Hello !

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.

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;
 

Reply via email to