mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
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).
This commit is contained in:
commit
54d95c0610
2
calmwm.h
2
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_ */
|
||||
|
6
client.c
6
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);
|
||||
|
3
conf.c
3
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;
|
||||
|
18
cwmrc.5
18
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
|
||||
|
1
kbfunc.c
1
kbfunc.c
@ -325,6 +325,7 @@ kbfunc_client_snap(void *ctx, struct cargs *cargs)
|
||||
}
|
||||
}
|
||||
client_move(cc);
|
||||
client_ptr_inbound(cc, 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
5
screen.c
5
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);
|
||||
|
@ -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)
|
||||
|
17
xmalloc.c
17
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user