mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
KNF, no binary change.
From Pierre Riteau. Thanks!
This commit is contained in:
parent
ec77265b87
commit
5034a77849
8
client.c
8
client.c
@ -330,9 +330,9 @@ client_maximize(struct client_ctx *cc)
|
|||||||
cc->geom.x = Conf.gap_left;
|
cc->geom.x = Conf.gap_left;
|
||||||
cc->geom.y = Conf.gap_top;
|
cc->geom.y = Conf.gap_top;
|
||||||
cc->geom.height = rootwin_geom.height -
|
cc->geom.height = rootwin_geom.height -
|
||||||
(Conf.gap_top + Conf.gap_bottom);
|
(Conf.gap_top + Conf.gap_bottom);
|
||||||
cc->geom.width = rootwin_geom.width -
|
cc->geom.width = rootwin_geom.width -
|
||||||
(Conf.gap_left + Conf.gap_right);
|
(Conf.gap_left + Conf.gap_right);
|
||||||
cc->flags |= CLIENT_DOMAXIMIZE;
|
cc->flags |= CLIENT_DOMAXIMIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -726,7 +726,7 @@ client_vertmaximize(struct client_ctx *cc)
|
|||||||
cc->savegeom = cc->geom;
|
cc->savegeom = cc->geom;
|
||||||
cc->geom.y = cc->bwidth + Conf.gap_top;
|
cc->geom.y = cc->bwidth + Conf.gap_top;
|
||||||
cc->geom.height = display_height -
|
cc->geom.height = display_height -
|
||||||
(Conf.gap_top + Conf.gap_bottom);
|
(Conf.gap_top + Conf.gap_bottom);
|
||||||
cc->flags |= CLIENT_DOVMAXIMIZE;
|
cc->flags |= CLIENT_DOVMAXIMIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -768,7 +768,7 @@ client_gethints(struct client_ctx *cc)
|
|||||||
|
|
||||||
mha = XInternAtom(X_Dpy, "_MOTIF_WM_HINTS", False);
|
mha = XInternAtom(X_Dpy, "_MOTIF_WM_HINTS", False);
|
||||||
if (xu_getprop(cc, mha, mha, PROP_MWM_HINTS_ELEMENTS,
|
if (xu_getprop(cc, mha, mha, PROP_MWM_HINTS_ELEMENTS,
|
||||||
(u_char **)&mwmh) == MWM_NUMHINTS)
|
(u_char **)&mwmh) == MWM_NUMHINTS)
|
||||||
if (mwmh->flags & MWM_HINTS_DECORATIONS &&
|
if (mwmh->flags & MWM_HINTS_DECORATIONS &&
|
||||||
!(mwmh->decorations & MWM_DECOR_ALL) &&
|
!(mwmh->decorations & MWM_DECOR_ALL) &&
|
||||||
!(mwmh->decorations & MWM_DECOR_BORDER))
|
!(mwmh->decorations & MWM_DECOR_BORDER))
|
||||||
|
4
conf.c
4
conf.c
@ -396,8 +396,8 @@ void conf_unbind(struct conf *c, struct keybinding *unbind)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((key->keycode != 0 && key->keysym == NoSymbol &&
|
if ((key->keycode != 0 && key->keysym == NoSymbol &&
|
||||||
key->keycode == unbind->keycode) ||
|
key->keycode == unbind->keycode) ||
|
||||||
key->keysym == unbind->keysym)
|
key->keysym == unbind->keysym)
|
||||||
TAILQ_REMOVE(&c->keybindingq, key, entry);
|
TAILQ_REMOVE(&c->keybindingq, key, entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
font.c
2
font.c
@ -67,7 +67,7 @@ font_init(struct screen_ctx *sc)
|
|||||||
errx(1, "XftDrawCreate");
|
errx(1, "XftDrawCreate");
|
||||||
|
|
||||||
if (!XAllocNamedColor(X_Dpy, DefaultColormap(X_Dpy, sc->which),
|
if (!XAllocNamedColor(X_Dpy, DefaultColormap(X_Dpy, sc->which),
|
||||||
"black", &xcolor, &tmp))
|
"black", &xcolor, &tmp))
|
||||||
errx(1, "XAllocNamedColor");
|
errx(1, "XAllocNamedColor");
|
||||||
|
|
||||||
sc->xftcolor.color.red = xcolor.red;
|
sc->xftcolor.color.red = xcolor.red;
|
||||||
|
10
grab.c
10
grab.c
@ -292,8 +292,7 @@ grab_label(struct client_ctx *cc)
|
|||||||
XMapRaised(X_Dpy, sc->searchwin);
|
XMapRaised(X_Dpy, sc->searchwin);
|
||||||
|
|
||||||
XGetInputFocus(X_Dpy, &focuswin, &focusrevert);
|
XGetInputFocus(X_Dpy, &focuswin, &focusrevert);
|
||||||
XSetInputFocus(X_Dpy, sc->searchwin,
|
XSetInputFocus(X_Dpy, sc->searchwin, RevertToPointerRoot, CurrentTime);
|
||||||
RevertToPointerRoot, CurrentTime);
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
XMaskEvent(X_Dpy, LabelMask, &e);
|
XMaskEvent(X_Dpy, LabelMask, &e);
|
||||||
@ -301,7 +300,7 @@ grab_label(struct client_ctx *cc)
|
|||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
if (input_keycodetrans(e.xkey.keycode, e.xkey.state,
|
if (input_keycodetrans(e.xkey.keycode, e.xkey.state,
|
||||||
&ctl, &chr, 0) < 0)
|
&ctl, &chr, 0) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
switch (ctl) {
|
switch (ctl) {
|
||||||
@ -348,9 +347,8 @@ grab_label(struct client_ctx *cc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
XSetInputFocus(X_Dpy, focuswin,
|
XSetInputFocus(X_Dpy, focuswin, focusrevert, CurrentTime);
|
||||||
focusrevert, CurrentTime);
|
|
||||||
XUnmapWindow(X_Dpy, sc->searchwin);
|
XUnmapWindow(X_Dpy, sc->searchwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
group.c
6
group.c
@ -272,10 +272,10 @@ group_menu(XButtonEvent *e)
|
|||||||
XCALLOC(mi, struct menu);
|
XCALLOC(mi, struct menu);
|
||||||
if (gc->hidden)
|
if (gc->hidden)
|
||||||
snprintf(mi->text, sizeof(mi->text), "%d: [%s]",
|
snprintf(mi->text, sizeof(mi->text), "%d: [%s]",
|
||||||
gc->shortcut, gc->name);
|
gc->shortcut, gc->name);
|
||||||
else
|
else
|
||||||
snprintf(mi->text, sizeof(mi->text), "%d: %s",
|
snprintf(mi->text, sizeof(mi->text), "%d: %s",
|
||||||
gc->shortcut, gc->name);
|
gc->shortcut, gc->name);
|
||||||
mi->ctx = gc;
|
mi->ctx = gc;
|
||||||
TAILQ_INSERT_TAIL(&menuq, mi, entry);
|
TAILQ_INSERT_TAIL(&menuq, mi, entry);
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ group_menu(XButtonEvent *e)
|
|||||||
else
|
else
|
||||||
_group_hide(gc);
|
_group_hide(gc);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
|
while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
|
||||||
TAILQ_REMOVE(&menuq, mi, entry);
|
TAILQ_REMOVE(&menuq, mi, entry);
|
||||||
xfree(mi);
|
xfree(mi);
|
||||||
|
8
search.c
8
search.c
@ -104,7 +104,7 @@ search_start(struct menu_q *menuq,
|
|||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
if (input_keycodetrans(e.xkey.keycode, e.xkey.state,
|
if (input_keycodetrans(e.xkey.keycode, e.xkey.state,
|
||||||
&ctl, &chr, 1) < 0)
|
&ctl, &chr, 1) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
switch (ctl) {
|
switch (ctl) {
|
||||||
@ -184,8 +184,8 @@ search_start(struct menu_q *menuq,
|
|||||||
if (TAILQ_EMPTY(&resultq) && list) {
|
if (TAILQ_EMPTY(&resultq) && list) {
|
||||||
/* Copy them all over. */
|
/* Copy them all over. */
|
||||||
TAILQ_FOREACH(mi, menuq, entry)
|
TAILQ_FOREACH(mi, menuq, entry)
|
||||||
TAILQ_INSERT_TAIL(&resultq, mi,
|
TAILQ_INSERT_TAIL(&resultq, mi,
|
||||||
resultentry);
|
resultentry);
|
||||||
|
|
||||||
listing = 1;
|
listing = 1;
|
||||||
} else if (mutated)
|
} else if (mutated)
|
||||||
@ -209,7 +209,7 @@ search_start(struct menu_q *menuq,
|
|||||||
}
|
}
|
||||||
|
|
||||||
dx = MAX(dx, font_width(font, text,
|
dx = MAX(dx, font_width(font, text,
|
||||||
MIN(strlen(text), MENU_MAXENTRY)));
|
MIN(strlen(text), MENU_MAXENTRY)));
|
||||||
dy += fontheight;
|
dy += fontheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
util.c
4
util.c
@ -49,9 +49,9 @@ u_exec(char *argstr)
|
|||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
while (ap < end && (*ap = strsep(&argstr, " \t")) != NULL) {
|
while (ap < end && (*ap = strsep(&argstr, " \t")) != NULL) {
|
||||||
if(**ap == '\0')
|
if (**ap == '\0')
|
||||||
continue;
|
continue;
|
||||||
ap++;
|
ap++;
|
||||||
if (argstr != NULL) {
|
if (argstr != NULL) {
|
||||||
/* deal with quoted strings */
|
/* deal with quoted strings */
|
||||||
switch(argstr[0]) {
|
switch(argstr[0]) {
|
||||||
|
@ -342,7 +342,7 @@ xev_handle_buttonpress(struct xevent *xev, XEvent *ee)
|
|||||||
client_lower(cc);
|
client_lower(cc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
xev_register(xev);
|
xev_register(xev);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,7 +422,7 @@ xev_handle_keyrelease(struct xevent *xev, XEvent *ee)
|
|||||||
*/
|
*/
|
||||||
client_mtf(NULL);
|
client_mtf(NULL);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
xev_register(xev);
|
xev_register(xev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
xutil.c
12
xutil.c
@ -25,15 +25,15 @@ int
|
|||||||
xu_ptr_grab(Window win, int mask, Cursor curs)
|
xu_ptr_grab(Window win, int mask, Cursor curs)
|
||||||
{
|
{
|
||||||
return (XGrabPointer(X_Dpy, win, False, mask,
|
return (XGrabPointer(X_Dpy, win, False, mask,
|
||||||
GrabModeAsync, GrabModeAsync,
|
GrabModeAsync, GrabModeAsync,
|
||||||
None, curs, CurrentTime) == GrabSuccess ? 0 : -1);
|
None, curs, CurrentTime) == GrabSuccess ? 0 : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xu_ptr_regrab(int mask, Cursor curs)
|
xu_ptr_regrab(int mask, Cursor curs)
|
||||||
{
|
{
|
||||||
return (XChangeActivePointerGrab(X_Dpy, mask,
|
return (XChangeActivePointerGrab(X_Dpy, mask,
|
||||||
curs, CurrentTime) == GrabSuccess ? 0 : -1);
|
curs, CurrentTime) == GrabSuccess ? 0 : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -46,8 +46,8 @@ int
|
|||||||
xu_btn_grab(Window win, int mask, u_int btn)
|
xu_btn_grab(Window win, int mask, u_int btn)
|
||||||
{
|
{
|
||||||
return (XGrabButton(X_Dpy, btn, mask, win,
|
return (XGrabButton(X_Dpy, btn, mask, win,
|
||||||
False, ButtonMask, GrabModeAsync,
|
False, ButtonMask, GrabModeAsync,
|
||||||
GrabModeSync, None, None) == GrabSuccess ? 0 : -1);
|
GrabModeSync, None, None) == GrabSuccess ? 0 : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -110,7 +110,7 @@ xu_getprop(struct client_ctx *cc, Atom atm, Atom type, long len, u_char **p)
|
|||||||
int format;
|
int format;
|
||||||
|
|
||||||
if (XGetWindowProperty(X_Dpy, cc->win, atm, 0L, len, False, type,
|
if (XGetWindowProperty(X_Dpy, cc->win, atm, 0L, len, False, type,
|
||||||
&realtype, &format, &n, &extra, p) != Success || *p == NULL)
|
&realtype, &format, &n, &extra, p) != Success || *p == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user