On Fri, Nov 06, 2015 at 12:47:08PM -0500, Okan Demirmen wrote:
> For 2 reasons, I'd like to change M1 (mouse-button1) menu from
> displaying only hidden windows to showing all windows.
>       - this is the only menu that differs between mouse and keyboard
>         invocations (kbd one shows all)
>       - allows using this menu to switch to unhidden/showing windows
>         that happen to be on another screen (but still visable)
> 
> Of course, search_print_client() will anotate each client's state, such
> as done in other menus.
> 
> Minimal diff below, leaving out the renaming and related stuff so it's
> not referenced only as 'unhide'.
> 
> Objections?
> 
> Thanks,
> Okan
> 
> Index: cwm.1
> ===================================================================
> RCS file: /home/open/cvs/xenocara/app/cwm/cwm.1,v
> retrieving revision 1.53
> diff -u -p -r1.53 cwm.1
> --- cwm.1     21 Aug 2015 16:52:37 -0000      1.53
> +++ cwm.1     6 Nov 2015 17:39:33 -0000
> @@ -224,8 +224,8 @@ Menus are recalled by clicking the mouse
>  .Pp
>  .Bl -tag -width Ds -offset indent -compact
>  .It Ic M1
> -Show list of currently hidden windows.
> -Selecting an item will unhide that window.
> +Show the list of windows.
> +Selecting an item will unhide, if nessecary, and warp to that window.
>  .It Ic M2
>  Show list of currently defined groups.
>  Selecting an item will hide/unhide that group.
> Index: mousefunc.c
> ===================================================================
> RCS file: /home/open/cvs/xenocara/app/cwm/mousefunc.c,v
> retrieving revision 1.98
> diff -u -p -r1.98 mousefunc.c
> --- mousefunc.c       21 Aug 2015 16:14:39 -0000      1.98
> +++ mousefunc.c       6 Nov 2015 17:21:08 -0000
> @@ -207,15 +207,14 @@ mousefunc_menu_unhide(struct client_ctx 
>  
>       TAILQ_INIT(&menuq);
>       TAILQ_FOREACH(cc, &sc->clientq, entry) {
> -             if (cc->flags & CLIENT_HIDDEN) {
> -                     menuq_add(&menuq, cc, NULL);
> -             }
> +             menuq_add(&menuq, cc, NULL);
>       }
>  
>       if ((mi = menu_filter(sc, &menuq, NULL, NULL, CWM_MENU_LIST,
>           NULL, search_print_client)) != NULL) {
>               cc = (struct client_ctx *)mi->ctx;
> -             client_unhide(cc);
> +             if (cc->flags & CLIENT_HIDDEN)
> +                     client_unhide(cc);
>               if (old_cc != NULL)
>                       client_ptrsave(old_cc);
>               client_ptrwarp(cc);
>

At least for me I wasn't previously using the M-/ C-A combo very often
and instead only used M1 to see a listen of windows I previously hidden
using CM-Return.

This will change my usage patterns for cwm, I'll have to pay attention
to window list flags (& !) that I was previously ignoring.

I also don't normally use the groups either, but I suppose I may be in
the minority.. so if this helps most users..

-Bryan.

Reply via email to