Allow a mouse binding to hide a window, and add a default keybinding for CMS-M3,

so it's hard to press by accident, but there if you need it.

requested (in a way) and tested by johan and todd.
This commit is contained in:
oga 2008-06-25 22:44:42 +00:00
parent a6ec6cd9e9
commit 993fd4311f
5 changed files with 14 additions and 1 deletions

View File

@ -457,6 +457,7 @@ void mousefunc_window_move(struct client_ctx *, void *);
void mousefunc_window_grouptoggle(struct client_ctx *, void mousefunc_window_grouptoggle(struct client_ctx *,
void *); void *);
void mousefunc_window_lower(struct client_ctx *, void *); void mousefunc_window_lower(struct client_ctx *, void *);
void mousefunc_window_hide(struct client_ctx *, void *);
void mousefunc_menu_group(struct client_ctx *, void *); void mousefunc_menu_group(struct client_ctx *, void *);
void mousefunc_menu_unhide(struct client_ctx *, void *); void mousefunc_menu_unhide(struct client_ctx *, void *);
void mousefunc_menu_cmd(struct client_ctx *, void *); void mousefunc_menu_cmd(struct client_ctx *, void *);

2
conf.c
View File

@ -166,6 +166,7 @@ conf_init(struct conf *c)
conf_mousebind(c, "CM-1", "window_grouptoggle"); conf_mousebind(c, "CM-1", "window_grouptoggle");
conf_mousebind(c, "M-2", "window_resize"); conf_mousebind(c, "M-2", "window_resize");
conf_mousebind(c, "M-3", "window_lower"); conf_mousebind(c, "M-3", "window_lower");
conf_mousebind(c, "CMS-3", "window_hide");
/* Default term/lock */ /* Default term/lock */
strlcpy(c->termpath, "xterm", sizeof(c->termpath)); strlcpy(c->termpath, "xterm", sizeof(c->termpath));
@ -406,6 +407,7 @@ struct {
{ "window_grouptoggle", mousefunc_window_grouptoggle, { "window_grouptoggle", mousefunc_window_grouptoggle,
MOUSEBIND_CTX_WIN }, MOUSEBIND_CTX_WIN },
{ "window_lower", mousefunc_window_lower, MOUSEBIND_CTX_WIN }, { "window_lower", mousefunc_window_lower, MOUSEBIND_CTX_WIN },
{ "window_hide", mousefunc_window_hide, MOUSEBIND_CTX_WIN },
{ "menu_group", mousefunc_menu_group, MOUSEBIND_CTX_ROOT }, { "menu_group", mousefunc_menu_group, MOUSEBIND_CTX_ROOT },
{ "menu_unhide", mousefunc_menu_unhide, MOUSEBIND_CTX_ROOT }, { "menu_unhide", mousefunc_menu_unhide, MOUSEBIND_CTX_ROOT },
{ "menu_cmd", mousefunc_menu_cmd, MOUSEBIND_CTX_ROOT }, { "menu_cmd", mousefunc_menu_cmd, MOUSEBIND_CTX_ROOT },

4
cwm.1
View File

@ -15,7 +15,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.\" The following requests are required for all man pages. .\" The following requests are required for all man pages.
.Dd $Mdocdate: June 5 2008 $ .Dd $Mdocdate: June 25 2008 $
.Dt CWM 1 .Dt CWM 1
.Os .Os
.Sh NAME .Sh NAME
@ -127,6 +127,8 @@ Toggle a window's membership in the current group.
Resize a window/select a window. Resize a window/select a window.
.It M-M3 .It M-M3
Lower a window. Lower a window.
.It CMS-M3
Hide a window.
.El .El
.Pp .Pp
The options for The options for

View File

@ -314,6 +314,8 @@ move a window
resize a window resize a window
.It window_lower .It window_lower
lower a window lower a window
.It window_hide
hide a window
.It window_grouptoggle .It window_grouptoggle
toggle group membership of a window toggle group membership of a window
.It menu_group .It menu_group

View File

@ -48,6 +48,12 @@ mousefunc_window_lower(struct client_ctx *cc, void *arg)
client_lower(cc); client_lower(cc);
} }
void
mousefunc_window_hide(struct client_ctx *cc, void *arg)
{
client_hide(cc);
}
void void
mousefunc_menu_group(struct client_ctx *cc, void *arg) mousefunc_menu_group(struct client_ctx *cc, void *arg)
{ {