stash window dimensions

This commit is contained in:
okan 2015-06-08 15:11:29 +00:00
parent 8653c88c90
commit 9180bb1a06
3 changed files with 8 additions and 3 deletions

View File

@ -169,6 +169,10 @@ struct client_ctx {
int x; /* x position */
int y; /* y position */
} ptr;
struct {
int h; /* hieght */
int w; /* width */
} dim;
#define CLIENT_HIDDEN 0x0001
#define CLIENT_IGNORE 0x0002
#define CLIENT_VMAXIMIZED 0x0004

View File

@ -874,6 +874,9 @@ client_applysizehints(struct client_ctx *cc)
cc->geom.w = MAX(cc->geom.w, 1);
cc->geom.h = MAX(cc->geom.h, 1);
cc->dim.w = (cc->geom.w - cc->hint.basew) / cc->hint.incw;
cc->dim.h = (cc->geom.h - cc->hint.baseh) / cc->hint.inch;
}
static void

View File

@ -53,9 +53,7 @@ mousefunc_sweep_draw(struct client_ctx *cc)
struct screen_ctx *sc = cc->sc;
char s[14]; /* fits " nnnn x nnnn \0" */
(void)snprintf(s, sizeof(s), " %4d x %-4d ",
(cc->geom.w - cc->hint.basew) / cc->hint.incw,
(cc->geom.h - cc->hint.baseh) / cc->hint.inch);
(void)snprintf(s, sizeof(s), " %4d x %-4d ", cc->dim.w, cc->dim.h);
XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0);
XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0,