more variable consistency

This commit is contained in:
okan 2013-01-02 02:19:20 +00:00
parent 2d28b71a1b
commit e492ed8e41
2 changed files with 30 additions and 30 deletions

View File

@ -255,8 +255,8 @@ void
client_maximize(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
int x_org, y_org, xmax, ymax;
XineramaScreenInfo *xine;
int x_org, y_org, xmax, ymax;
if (cc->flags & CLIENT_FREEZE)
return;
@ -312,8 +312,8 @@ void
client_vertmaximize(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
int y_org, ymax;
XineramaScreenInfo *xine;
int y_org, ymax;
if (cc->flags & CLIENT_FREEZE)
return;
@ -361,8 +361,8 @@ void
client_horizmaximize(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
int x_org, xmax;
XineramaScreenInfo *xine;
int x_org, xmax;
if (cc->flags & CLIENT_FREEZE)
return;
@ -683,46 +683,46 @@ client_placecalc(struct client_ctx *cc)
cc->geom.y = MIN(cc->size->y, yslack);
} else {
XineramaScreenInfo *xine;
int xmouse, ymouse, xorig, yorig;
int xmax, ymax;
int x_org, y_org, xmax, ymax;
int xmouse, ymouse;
xu_ptr_getpos(sc->rootwin, &xmouse, &ymouse);
xine = screen_find_xinerama(sc, xmouse, ymouse);
if (xine) {
xorig = xine->x_org;
yorig = xine->y_org;
xmax = xorig + xine->width;
ymax = yorig + xine->height;
x_org = xine->x_org;
y_org = xine->y_org;
xmax = xine->x_org + xine->width;
ymax = xine->y_org + xine->height;
} else {
xorig = yorig = 0;
x_org = y_org = 0;
xmax = sc->view.w;
ymax = sc->view.h;
}
xmouse = MAX(xmouse, xorig) - cc->geom.w / 2;
ymouse = MAX(ymouse, yorig) - cc->geom.h / 2;
xmouse = MAX(xmouse, x_org) - cc->geom.w / 2;
ymouse = MAX(ymouse, y_org) - cc->geom.h / 2;
xmouse = MAX(xmouse, xorig);
ymouse = MAX(ymouse, yorig);
xmouse = MAX(xmouse, x_org);
ymouse = MAX(ymouse, y_org);
xslack = xmax - cc->geom.w - cc->bwidth * 2;
yslack = ymax - cc->geom.h - cc->bwidth * 2;
if (xslack >= xorig) {
if (xslack >= x_org) {
cc->geom.x = MAX(MIN(xmouse, xslack),
xorig + sc->gap.left);
x_org + sc->gap.left);
if (cc->geom.x > (xslack - sc->gap.right))
cc->geom.x -= sc->gap.right;
} else {
cc->geom.x = xorig + sc->gap.left;
cc->geom.x = x_org + sc->gap.left;
cc->geom.w = xmax - sc->gap.left;
}
if (yslack >= yorig) {
if (yslack >= y_org) {
cc->geom.y = MAX(MIN(ymouse, yslack),
yorig + sc->gap.top);
y_org + sc->gap.top);
if (cc->geom.y > (yslack - sc->gap.bottom))
cc->geom.y -= sc->gap.bottom;
} else {
cc->geom.y = yorig + sc->gap.top;
cc->geom.y = y_org + sc->gap.top;
cc->geom.h = ymax - sc->gap.top;
}
}

20
menu.c
View File

@ -351,7 +351,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
{
struct menu *mi;
XineramaScreenInfo *xine;
int xmin, xmax, ymin, ymax;
int x_org, y_org, xmax, ymax;
int n, xsave, ysave;
if (mc->list) {
@ -396,12 +396,12 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
xine = screen_find_xinerama(sc, mc->x, mc->y);
if (xine) {
xmin = xine->x_org;
x_org = xine->x_org;
y_org = xine->y_org;
xmax = xine->x_org + xine->width;
ymin = xine->y_org;
ymax = xine->y_org + xine->height;
} else {
xmin = ymin = 0;
x_org = y_org = 0;
xmax = sc->view.w;
ymax = sc->view.h;
}
@ -412,15 +412,15 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
/* Never hide the top, or left side, of the menu. */
if (mc->x + mc->width >= xmax)
mc->x = xmax - mc->width;
if (mc->x < xmin) {
mc->x = xmin;
mc->width = xmax - xmin;
if (mc->x < x_org) {
mc->x = x_org;
mc->width = xmax - x_org;
}
if (mc->y + mc->height >= ymax)
mc->y = ymax - mc->height;
if (mc->y < ymin) {
mc->y = ymin;
mc->height = ymax - ymin;
if (mc->y < y_org) {
mc->y = y_org;
mc->height = ymax - y_org;
}
if (mc->x != xsave || mc->y != ysave)