From 5a905031f4c1ff097630867ec92b3ec896fe9e7e Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 1 Dec 2016 18:17:52 +0000 Subject: [PATCH] Change 'menu-window' to display all windows; then add 'menu-window-hidden' for the previous behaviour of 'menu-window'. 'menu-window' becomes the default binding; use 'bind-mouse "1" menu-window-hidden' to restore old behaviour for those who prefer. OK sthen@ (long long time ago on a different version) --- app/cwm/calmwm.h | 4 +++- app/cwm/conf.c | 7 +++++-- app/cwm/cwm.1 | 8 ++++---- app/cwm/cwmrc.5 | 4 +++- app/cwm/kbfunc.c | 5 +++-- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 8861a3463..c6e0246f3 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.333 2016/11/15 00:22:02 okan Exp $ + * $OpenBSD: calmwm.h,v 1.334 2016/12/01 18:17:52 okan Exp $ */ #ifndef _CALMWM_H_ @@ -261,6 +261,8 @@ enum menu_exec { #define CWM_MENU_DUMMY 0x0001 #define CWM_MENU_FILE 0x0002 #define CWM_MENU_LIST 0x0004 +#define CWM_MENU_WINDOW_ALL 0x0008 +#define CWM_MENU_WINDOW_HIDDEN 0x0010 struct menu { TAILQ_ENTRY(menu) entry; diff --git a/app/cwm/conf.c b/app/cwm/conf.c index a8473a7cc..522c23980 100644 --- a/app/cwm/conf.c +++ b/app/cwm/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.225 2016/12/01 17:17:27 okan Exp $ + * $OpenBSD: conf.c,v 1.226 2016/12/01 18:17:52 okan Exp $ */ #include @@ -174,7 +174,10 @@ static const struct { { "menu-cmd", kbfunc_menu_cmd, CWM_CONTEXT_SC, {0} }, { "menu-group", kbfunc_menu_group, CWM_CONTEXT_SC, {0} }, { "menu-ssh", kbfunc_menu_ssh, CWM_CONTEXT_SC, {0} }, - { "menu-window", kbfunc_menu_client, CWM_CONTEXT_SC, {0} }, + { "menu-window", kbfunc_menu_client, CWM_CONTEXT_SC, + {.i = CWM_MENU_WINDOW_ALL} }, + { "menu-window-hidden", kbfunc_menu_client, CWM_CONTEXT_SC, + {.i = CWM_MENU_WINDOW_HIDDEN} }, { "menu-exec", kbfunc_menu_exec, CWM_CONTEXT_SC, {.i = CWM_MENU_EXEC_EXEC} }, { "menu-exec-wm", kbfunc_menu_exec, CWM_CONTEXT_SC, diff --git a/app/cwm/cwm.1 b/app/cwm/cwm.1 index 23350b878..2fc12e4f1 100644 --- a/app/cwm/cwm.1 +++ b/app/cwm/cwm.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cwm.1,v 1.56 2016/11/14 13:52:33 okan Exp $ +.\" $OpenBSD: cwm.1,v 1.57 2016/12/01 18:17:52 okan Exp $ .\" .\" Copyright (c) 2004,2005 Marius Aamodt Eriksen .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 14 2016 $ +.Dd $Mdocdate: December 1 2016 $ .Dt CWM 1 .Os .Sh NAME @@ -219,8 +219,8 @@ Menus are recalled by clicking the mouse on the root window: .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 list of currently defined windows. +Selecting an item will warp to that window, unhiding it if necessary. .It Ic M2 Show list of currently defined groups. Selecting an item will hide/unhide that group. diff --git a/app/cwm/cwmrc.5 b/app/cwm/cwmrc.5 index df0c08eef..70de6ed32 100644 --- a/app/cwm/cwmrc.5 +++ b/app/cwm/cwmrc.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cwmrc.5,v 1.64 2016/12/01 17:17:27 okan Exp $ +.\" $OpenBSD: cwmrc.5,v 1.65 2016/12/01 18:17:52 okan Exp $ .\" .\" Copyright (c) 2004,2005 Marius Aamodt Eriksen .\" @@ -261,6 +261,8 @@ Spawn a new terminal. Lock the screen. .It menu-window Launch window search menu. +.It menu-window-hidden +Launch hidden window search menu. .It menu-cmd Launch application search menu. .It menu-group diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index 6c4aa9ac4..2a9cc4b22 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: kbfunc.c,v 1.137 2016/11/15 18:43:09 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.138 2016/12/01 18:17:52 okan Exp $ */ #include @@ -298,12 +298,13 @@ kbfunc_menu_client(void *ctx, union arg *arg, enum xev xev) struct menu *mi; struct menu_q menuq; int m = (xev == CWM_XEV_BTN); + int all = (arg->i & CWM_MENU_WINDOW_ALL); old_cc = client_current(); TAILQ_INIT(&menuq); TAILQ_FOREACH(cc, &sc->clientq, entry) { - if (m) { + if (!all) { if (cc->flags & CLIENT_HIDDEN) menuq_add(&menuq, cc, NULL); } else