mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
compact a bit by condensing a few if-else's; from Thomas Pfaff
"go on then" oga@
This commit is contained in:
parent
58d12134b1
commit
bcc0f73bb6
12
client.c
12
client.c
@ -113,11 +113,7 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
|
|||||||
/* Notify client of its configuration. */
|
/* Notify client of its configuration. */
|
||||||
xev_reconfig(cc);
|
xev_reconfig(cc);
|
||||||
|
|
||||||
if (state == IconicState)
|
(state == IconicState) ? client_hide(cc) : client_unhide(cc);
|
||||||
client_hide(cc);
|
|
||||||
else
|
|
||||||
client_unhide(cc);
|
|
||||||
|
|
||||||
xu_setstate(cc, cc->state);
|
xu_setstate(cc, cc->state);
|
||||||
|
|
||||||
XSync(X_Dpy, False);
|
XSync(X_Dpy, False);
|
||||||
@ -345,11 +341,7 @@ client_ptrwarp(struct client_ctx *cc)
|
|||||||
y = cc->geom.height / 2;
|
y = cc->geom.height / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->state == IconicState)
|
(cc->state == IconicState) ? client_unhide(cc) : client_raise(cc);
|
||||||
client_unhide(cc);
|
|
||||||
else
|
|
||||||
client_raise(cc);
|
|
||||||
|
|
||||||
xu_ptr_setpos(cc->win, x, y);
|
xu_ptr_setpos(cc->win, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
group.c
10
group.c
@ -325,10 +325,7 @@ group_menu(XButtonEvent *e)
|
|||||||
|
|
||||||
gc = (struct group_ctx *)mi->ctx;
|
gc = (struct group_ctx *)mi->ctx;
|
||||||
|
|
||||||
if (gc->hidden)
|
(gc->hidden) ? group_show(gc) : group_hide(gc);
|
||||||
group_show(gc);
|
|
||||||
else
|
|
||||||
group_hide(gc);
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
|
while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
|
||||||
@ -349,10 +346,7 @@ group_alltoggle(void)
|
|||||||
group_hide(&Groups[i]);
|
group_hide(&Groups[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Grouphideall)
|
Grouphideall = (Grouphideall) ? 0 : 1;
|
||||||
Grouphideall = 0;
|
|
||||||
else
|
|
||||||
Grouphideall = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
5
input.c
5
input.c
@ -29,10 +29,7 @@ input_keycodetrans(KeyCode kc, u_int state, enum ctltype *ctl, char *chr)
|
|||||||
*ctl = CTL_NONE;
|
*ctl = CTL_NONE;
|
||||||
*chr = '\0';
|
*chr = '\0';
|
||||||
|
|
||||||
if (state & ShiftMask)
|
ks = XKeycodeToKeysym(X_Dpy, kc, (state & ShiftMask) ? 1 : 0);
|
||||||
ks = XKeycodeToKeysym(X_Dpy, kc, 1);
|
|
||||||
else
|
|
||||||
ks = XKeycodeToKeysym(X_Dpy, kc, 0);
|
|
||||||
|
|
||||||
/* Look for control characters. */
|
/* Look for control characters. */
|
||||||
switch (ks) {
|
switch (ks) {
|
||||||
|
5
kbfunc.c
5
kbfunc.c
@ -412,10 +412,7 @@ kbfunc_client_label(struct client_ctx *cc, union arg *arg)
|
|||||||
|
|
||||||
TAILQ_INIT(&menuq);
|
TAILQ_INIT(&menuq);
|
||||||
|
|
||||||
if (cc->label != NULL)
|
current = cc->label;
|
||||||
current = cc->label;
|
|
||||||
else
|
|
||||||
current = NULL;
|
|
||||||
|
|
||||||
if ((mi = menu_filter(&menuq, "label", current, 1,
|
if ((mi = menu_filter(&menuq, "label", current, 1,
|
||||||
search_match_text, NULL)) != NULL) {
|
search_match_text, NULL)) != NULL) {
|
||||||
|
@ -226,11 +226,7 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg)
|
|||||||
TAILQ_INIT(&menuq);
|
TAILQ_INIT(&menuq);
|
||||||
TAILQ_FOREACH(cc, &Clientq, entry)
|
TAILQ_FOREACH(cc, &Clientq, entry)
|
||||||
if (cc->flags & CLIENT_HIDDEN) {
|
if (cc->flags & CLIENT_HIDDEN) {
|
||||||
if (cc->label != NULL)
|
wname = (cc->label) ? cc->label : cc->name;
|
||||||
wname = cc->label;
|
|
||||||
else
|
|
||||||
wname = cc->name;
|
|
||||||
|
|
||||||
if (wname == NULL)
|
if (wname == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user