mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
simplify/unfold
This commit is contained in:
parent
fa25915a75
commit
250f98bf15
8
client.c
8
client.c
@ -781,12 +781,10 @@ client_applysizehints(struct client_ctx *cc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* adjust for aspect limits */
|
/* adjust for aspect limits */
|
||||||
if (cc->hint.mina > 0 && cc->hint.maxa > 0) {
|
if (cc->hint.mina && cc->hint.maxa) {
|
||||||
if (cc->hint.maxa <
|
if (cc->hint.maxa < (float)cc->geom.w / cc->geom.h)
|
||||||
(float)cc->geom.w / cc->geom.h)
|
|
||||||
cc->geom.w = cc->geom.h * cc->hint.maxa;
|
cc->geom.w = cc->geom.h * cc->hint.maxa;
|
||||||
else if (cc->hint.mina <
|
else if (cc->hint.mina < (float)cc->geom.h / cc->geom.w)
|
||||||
(float)cc->geom.h / cc->geom.w)
|
|
||||||
cc->geom.h = cc->geom.w * cc->hint.mina;
|
cc->geom.h = cc->geom.w * cc->hint.mina;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
mousefunc.c
10
mousefunc.c
@ -50,21 +50,19 @@ static void
|
|||||||
mousefunc_sweep_draw(struct client_ctx *cc)
|
mousefunc_sweep_draw(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
struct screen_ctx *sc = cc->sc;
|
struct screen_ctx *sc = cc->sc;
|
||||||
char asize[14]; /* fits " nnnn x nnnn \0" */
|
char s[14]; /* fits " nnnn x nnnn \0" */
|
||||||
|
|
||||||
(void)snprintf(asize, sizeof(asize), " %4d x %-4d ",
|
(void)snprintf(s, sizeof(s), " %4d x %-4d ",
|
||||||
(cc->geom.w - cc->hint.basew) / cc->hint.incw,
|
(cc->geom.w - cc->hint.basew) / cc->hint.incw,
|
||||||
(cc->geom.h - cc->hint.baseh) / cc->hint.inch);
|
(cc->geom.h - cc->hint.baseh) / cc->hint.inch);
|
||||||
|
|
||||||
XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0);
|
XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0);
|
||||||
XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0,
|
XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0,
|
||||||
xu_xft_width(sc->xftfont, asize, strlen(asize)),
|
xu_xft_width(sc->xftfont, s, strlen(s)), sc->xftfont->height);
|
||||||
sc->xftfont->height);
|
|
||||||
XMapWindow(X_Dpy, sc->menuwin);
|
XMapWindow(X_Dpy, sc->menuwin);
|
||||||
XClearWindow(X_Dpy, sc->menuwin);
|
XClearWindow(X_Dpy, sc->menuwin);
|
||||||
|
|
||||||
xu_xft_draw(sc, asize, CWM_COLOR_MENU_FONT,
|
xu_xft_draw(sc, s, CWM_COLOR_MENU_FONT, 0, sc->xftfont->ascent + 1);
|
||||||
0, sc->xftfont->ascent + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user