summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2020-02-07 18:53:41 +0000
committerokan <okan>2020-02-07 18:53:41 +0000
commit54d95c06109091056d3f8b2ac73e2ebc30e090e6 (patch)
tree0d9a5a4b111137ae40f90920edbcf537208e6328
parent450ab06ab776e972a4c401aa91ba9627464fa513 (diff)
parent7a88b2bdb2789e549ed4caab37c814198e347696 (diff)
downloadcwm-54d95c06109091056d3f8b2ac73e2ebc30e090e6.tar.gz
cwm-54d95c06109091056d3f8b2ac73e2ebc30e090e6.tar.xz
cwm-54d95c06109091056d3f8b2ac73e2ebc30e090e6.zip
cvsimport
* refs/heads/master:
  Allow the 'empty' group clients to be window-{h,v}tile'd.
  Map ('5') and allow mod5mask (altgr) as a modifier.
  add, then use, xvasprintf, checking for appropriate return.
  Ensure the pointer stays within client bounds after a window 'snap' (to edge).
-rw-r--r--calmwm.h2
-rw-r--r--client.c6
-rw-r--r--conf.c3
-rw-r--r--cwmrc.518
-rw-r--r--kbfunc.c1
-rw-r--r--screen.c5
-rw-r--r--xevents.c2
-rw-r--r--xmalloc.c15
8 files changed, 25 insertions, 27 deletions
diff --git a/calmwm.h b/calmwm.h
index d15f39d..bd34cb2 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -619,5 +619,7 @@ char			*xstrdup(const char *);
 int			 xasprintf(char **, const char *, ...)
 			    __attribute__((__format__ (printf, 2, 3)))
 			    __attribute__((__nonnull__ (2)));
+int			 xvasprintf(char **, const char *, va_list)
+			    __attribute__((__nonnull__ (2)));
 
 #endif /* _CALMWM_H_ */
diff --git a/client.c b/client.c
index 39df4d3..2384f59 100644
--- a/client.c
+++ b/client.c
@@ -971,10 +971,7 @@ client_htile(struct client_ctx *cc)
 	struct geom 		 area;
 	int 			 i, n, mh, x, w, h;
 
-	if (!cc->gc)
-		return;
 	i = n = 0;
-
 	area = screen_area(sc,
 	    cc->geom.x + cc->geom.w / 2,
 	    cc->geom.y + cc->geom.h / 2, CWM_GAP);
@@ -1042,10 +1039,7 @@ client_vtile(struct client_ctx *cc)
 	struct geom 		 area;
 	int 			 i, n, mw, y, w, h;
 
-	if (!cc->gc)
-		return;
 	i = n = 0;
-
 	area = screen_area(sc,
 	    cc->geom.x + cc->geom.w / 2,
 	    cc->geom.y + cc->geom.h / 2, CWM_GAP);
diff --git a/conf.c b/conf.c
index e42c18f..7d1233d 100644
--- a/conf.c
+++ b/conf.c
@@ -197,10 +197,11 @@ static const struct {
 	const char	ch;
 	int		mask;
 } bind_mods[] = {
+	{ 'S',	ShiftMask },
 	{ 'C',	ControlMask },
 	{ 'M',	Mod1Mask },
 	{ '4',	Mod4Mask },
-	{ 'S',	ShiftMask },
+	{ '5',	Mod5Mask },
 };
 static const struct {
 	const char	*key;
diff --git a/cwmrc.5 b/cwmrc.5
index 41093a5..5208d29 100644
--- a/cwmrc.5
+++ b/cwmrc.5
@@ -84,6 +84,8 @@ Meta key.
 Shift key.
 .It Ic 4
 Mod4 (windows) key.
+.It Ic 5
+Mod5 (AltGr) key.
 .El
 .Pp
 The
@@ -101,18 +103,10 @@ The modifier keys come first, followed by a
 .Sq - ,
 then the button number.
 .Pp
-The following modifiers are recognised:
-.Pp
-.Bl -tag -width Ds -offset indent -compact
-.It Ic C
-Control key.
-.It Ic M
-Meta key.
-.It Ic S
-Shift key.
-.It Ic 4
-Mod4 (windows) key.
-.El
+The same modifiers are recognised as for
+.Ar key
+in
+.Nm bind-key .
 .Pp
 The following buttons are recognised:
 .Pp
diff --git a/kbfunc.c b/kbfunc.c
index cd4ef1c..551ccc7 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -325,6 +325,7 @@ kbfunc_client_snap(void *ctx, struct cargs *cargs)
 		}
 	}
 	client_move(cc);
+	client_ptr_inbound(cc, 1);
 }
 
 void
diff --git a/screen.c b/screen.c
index 7565703..4ef86d5 100644
--- a/screen.c
+++ b/screen.c
@@ -275,15 +275,12 @@ void
 screen_prop_win_draw(struct screen_ctx *sc, const char *fmt, ...)
 {
 	va_list			 ap;
-	int			 i;
 	char			*text;
 	XGlyphInfo		 extents;
 
 	va_start(ap, fmt);
-	i = vasprintf(&text, fmt, ap);
+	xvasprintf(&text, fmt, ap);
 	va_end(ap);
-	if (i < 0 || text == NULL)
-		err(1, "vasprintf");
 
 	XftTextExtentsUtf8(X_Dpy, sc->xftfont, (const FcChar8*)text,
 	    strlen(text), &extents);
diff --git a/xevents.c b/xevents.c
index dd4bcb3..fbd93c5 100644
--- a/xevents.c
+++ b/xevents.c
@@ -69,7 +69,7 @@ void		(*xev_handlers[LASTEvent])(XEvent *) = {
 };
 
 static KeySym modkeys[] = { XK_Alt_L, XK_Alt_R, XK_Super_L, XK_Super_R,
-			    XK_Control_L, XK_Control_R };
+			    XK_Control_L, XK_Control_R, XK_ISO_Level3_Shift };
 
 static void
 xev_handle_maprequest(XEvent *ee)
diff --git a/xmalloc.c b/xmalloc.c
index ccfaa67..1041648 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -91,11 +91,20 @@ xasprintf(char **ret, const char *fmt, ...)
 	int	 i;
 
 	va_start(ap, fmt);
-	i = vasprintf(ret, fmt, ap);
+	i = xvasprintf(ret, fmt, ap);
 	va_end(ap);
 
-	if (i < 0 || *ret == NULL)
-		err(1, "asprintf");
+	return(i);
+}
+
+int
+xvasprintf(char **ret, const char *fmt, va_list ap)
+{
+	int	 i;
+
+	i = vasprintf(ret, fmt, ap);
+	if (i == -1)
+		err(1, "vasprintf");
 
 	return(i);
 }