aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2013-07-08 18:39:20 +0000
committerokan2013-07-08 18:39:20 +0000
commitee5ad9e95b20897654c9830178f8f707b65adbe8 (patch)
tree62b269e17ff50d137c5d39262d73d2e596f37b47
parent63e9ed547d2b6c27553b71a57d79d8afce15e2c5 (diff)
downloadcwm-ee5ad9e95b20897654c9830178f8f707b65adbe8.tar.gz
add support for mouse based group {,r}cycle; from Rodrigo Mosconi. not
bound by default.
-rw-r--r--calmwm.h6
-rw-r--r--conf.c4
-rw-r--r--cwmrc.58
-rw-r--r--mousefunc.c14
4 files changed, 27 insertions, 5 deletions
diff --git a/calmwm.h b/calmwm.h
index c3a68d9..d5bf6da 100644
--- a/calmwm.h
+++ b/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.215 2013/07/08 18:19:22 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.216 2013/07/08 18:39:20 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -424,12 +424,16 @@ void kbfunc_ssh(struct client_ctx *, union arg *);
void kbfunc_term(struct client_ctx *, union arg *);
void kbfunc_tile(struct client_ctx *, union arg *);
+void mousefunc_client_cyclegroup(struct client_ctx *,
+ void *);
void mousefunc_client_grouptoggle(struct client_ctx *,
void *);
void mousefunc_client_hide(struct client_ctx *, void *);
void mousefunc_client_lower(struct client_ctx *, void *);
void mousefunc_client_move(struct client_ctx *, void *);
void mousefunc_client_raise(struct client_ctx *, void *);
+void mousefunc_client_rcyclegroup(struct client_ctx *,
+ void *);
void mousefunc_client_resize(struct client_ctx *, void *);
void mousefunc_menu_cmd(struct client_ctx *, void *);
void mousefunc_menu_group(struct client_ctx *, void *);
diff --git a/conf.c b/conf.c
index cdb7972..5da4a13 100644
--- a/conf.c
+++ b/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.140 2013/07/08 18:19:22 okan Exp $
+ * $OpenBSD: conf.c,v 1.141 2013/07/08 18:39:20 okan Exp $
*/
#include <sys/param.h>
@@ -550,6 +550,8 @@ static struct {
{ "window_lower", mousefunc_client_lower, MOUSEBIND_CTX_WIN },
{ "window_raise", mousefunc_client_raise, MOUSEBIND_CTX_WIN },
{ "window_hide", mousefunc_client_hide, MOUSEBIND_CTX_WIN },
+ { "cyclegroup", mousefunc_client_cyclegroup, MOUSEBIND_CTX_ROOT },
+ { "rcyclegroup", mousefunc_client_rcyclegroup, MOUSEBIND_CTX_ROOT },
{ "menu_group", mousefunc_menu_group, MOUSEBIND_CTX_ROOT },
{ "menu_unhide", mousefunc_menu_unhide, MOUSEBIND_CTX_ROOT },
{ "menu_cmd", mousefunc_menu_cmd, MOUSEBIND_CTX_ROOT },
diff --git a/cwmrc.5 b/cwmrc.5
index 5f86fcc..6d4684f 100644
--- a/cwmrc.5
+++ b/cwmrc.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: cwmrc.5,v 1.53 2013/06/17 00:57:47 okan Exp $
+.\" $OpenBSD: cwmrc.5,v 1.54 2013/07/08 18:39:20 okan Exp $
.\"
.\" Copyright (c) 2004,2005 Marius Aamodt Eriksen <marius@monkey.org>
.\"
@@ -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: June 17 2013 $
+.Dd $Mdocdate: July 8 2013 $
.Dt CWMRC 5
.Os
.Sh NAME
@@ -463,6 +463,10 @@ Raise current window.
Hide current window.
.It window_grouptoggle
Toggle group membership of current window.
+.It cyclegroup
+Forward cycle through groups.
+.It rcyclegroup
+Reverse cycle through groups.
.It menu_group
Launch group list.
.It menu_unhide
diff --git a/mousefunc.c b/mousefunc.c
index c44c3fc..366ad9e 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: mousefunc.c,v 1.54 2013/07/08 18:19:22 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.55 2013/07/08 18:39:20 okan Exp $
*/
#include <sys/param.h>
@@ -202,6 +202,18 @@ mousefunc_client_hide(struct client_ctx *cc, void *arg)
}
void
+mousefunc_client_cyclegroup(struct client_ctx *cc, void *arg)
+{
+ group_cycle(cc->sc, CWM_CYCLE);
+}
+
+void
+mousefunc_client_rcyclegroup(struct client_ctx *cc, void *arg)
+{
+ group_cycle(cc->sc, CWM_RCYCLE);
+}
+
+void
mousefunc_menu_group(struct client_ctx *cc, void *arg)
{
group_menu(arg);