Use pointer when using geo in client.c
This commit is contained in:
parent
a603802d9f
commit
39380848a0
26
src/client.c
26
src/client.c
@ -162,8 +162,8 @@ client_swap(struct client *c1, struct client *c2)
|
||||
tag_client(c2->tag, c1);
|
||||
tag_client(t, c2);
|
||||
|
||||
client_moveresize(c1, c2->geo);
|
||||
client_moveresize(c2, g);
|
||||
client_moveresize(c1, &c2->geo);
|
||||
client_moveresize(c2, &g);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -198,9 +198,9 @@ client_grabbuttons(struct client *c, bool focused)
|
||||
static inline void
|
||||
client_draw_bord(struct client *c)
|
||||
{
|
||||
struct geo g = { 0, 0, c->screen->ugeo.w, c->screen->ugeo.h };
|
||||
struct geo ge = { 0, 0, c->screen->ugeo.w, c->screen->ugeo.h };
|
||||
|
||||
draw_rect(c->tag->frame, g, THEME_DEFAULT->client_n.bg);
|
||||
draw_rect(c->tag->frame, ge, THEME_DEFAULT->client_n.bg);
|
||||
|
||||
/* Selected client's border */
|
||||
if(W->client)
|
||||
@ -336,17 +336,17 @@ client_new(Window w, XWindowAttributes *wa)
|
||||
}
|
||||
|
||||
void
|
||||
client_moveresize(struct client *c, struct geo g)
|
||||
client_moveresize(struct client *c, struct geo *g)
|
||||
{
|
||||
int bord = THEME_DEFAULT->client_border_width;
|
||||
|
||||
c->geo = g;
|
||||
c->geo = *g;
|
||||
|
||||
/* Window geo */
|
||||
c->wgeo.x = g.x + bord;
|
||||
c->wgeo.y = g.y + bord ;
|
||||
c->wgeo.w = g.w - (bord << 1);
|
||||
c->wgeo.h = g.h - (bord << 1);
|
||||
c->wgeo.x = g->x + bord;
|
||||
c->wgeo.y = g->y + bord ;
|
||||
c->wgeo.w = g->w - (bord << 1);
|
||||
c->wgeo.h = g->h - (bord << 1);
|
||||
|
||||
XMoveResizeWindow(W->dpy, c->win,
|
||||
c->wgeo.x, c->wgeo.y,
|
||||
@ -365,7 +365,7 @@ client_maximize(struct client *c)
|
||||
c->geo.w = c->tag->screen->ugeo.w;
|
||||
c->geo.h = c->tag->screen->ugeo.h;
|
||||
|
||||
client_moveresize(c, c->geo);
|
||||
client_moveresize(c, &c->geo);
|
||||
}
|
||||
|
||||
void
|
||||
@ -388,8 +388,8 @@ client_fac_resize(struct client *c, enum position p, int fac)
|
||||
/* Simple resize with only c & gc */
|
||||
if(GEO_CHECK2(c->geo, gc->geo, p))
|
||||
{
|
||||
client_moveresize(c, c->tgeo);
|
||||
client_moveresize(gc, gc->tgeo);
|
||||
client_moveresize(c, &c->tgeo);
|
||||
client_moveresize(gc, &gc->tgeo);
|
||||
}
|
||||
/* Resize with row parents */
|
||||
else
|
||||
|
||||
@ -19,7 +19,7 @@ void client_get_name(struct client *c);
|
||||
void client_close(struct client *c);
|
||||
void uicb_client_close(Uicb cmd);
|
||||
struct client *client_new(Window w, XWindowAttributes *wa);
|
||||
void client_moveresize(struct client *c, struct geo g);
|
||||
void client_moveresize(struct client *c, struct geo *g);
|
||||
void client_maximize(struct client *c);
|
||||
void client_fac_resize(struct client *c, enum position p, int fac);
|
||||
void client_remove(struct client *c);
|
||||
@ -122,7 +122,7 @@ client_fac_arrange_row(struct client *c, enum position p, int fac)
|
||||
if(GEO_PARENTROW(g, cc->geo, p))
|
||||
{
|
||||
client_fac_geo(cc, p, fac);
|
||||
client_moveresize(cc, cc->tgeo);
|
||||
client_moveresize(cc, &cc->tgeo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
14
src/layout.c
14
src/layout.c
@ -34,7 +34,7 @@ layout_split(struct client *c, bool vertical)
|
||||
geo.h += (og.y + og.h) - (geo.y + geo.h);
|
||||
}
|
||||
|
||||
client_moveresize(c, c->geo);
|
||||
client_moveresize(c, &c->geo);
|
||||
|
||||
return geo;
|
||||
}
|
||||
@ -57,7 +57,7 @@ layout_split_arrange_size(struct geo *g, struct client *c, enum position p)
|
||||
c->geo.y = g->y;
|
||||
}
|
||||
|
||||
client_moveresize(c, c->geo);
|
||||
client_moveresize(c, &c->geo);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
@ -166,7 +166,7 @@ layout_split_integrate(struct client *c, struct client *sc)
|
||||
}
|
||||
|
||||
g = layout_split(sc, (sc->geo.h < sc->geo.w));
|
||||
client_moveresize(c, g);
|
||||
client_moveresize(c, &g);
|
||||
}
|
||||
|
||||
/* Arrange inter-clients holes:
|
||||
@ -194,7 +194,7 @@ layout_fix_hole(struct client *c)
|
||||
c->geo.w += (cr ? cr->geo.x : c->screen->ugeo.w) - (c->geo.x + c->geo.w);
|
||||
c->geo.h += (cb ? cb->geo.y : c->screen->ugeo.h) - (c->geo.y + c->geo.h);
|
||||
|
||||
client_moveresize(c, c->geo);
|
||||
client_moveresize(c, &c->geo);
|
||||
}
|
||||
|
||||
/* Layout rotation: Rotate 90° all client to right or left.
|
||||
@ -249,7 +249,7 @@ layout_rotate(struct tag *t, bool left)
|
||||
g.w = c->geo.h * f1;
|
||||
g.h = c->geo.w * f2;
|
||||
|
||||
client_moveresize(c, g);
|
||||
client_moveresize(c, &g);
|
||||
}
|
||||
|
||||
/* Rotate sometimes do not set back perfect size.. */
|
||||
@ -298,7 +298,7 @@ uicb_layout_vmirror(Uicb cmd)
|
||||
SLIST_FOREACH(c, &W->screen->seltag->clients, tnext)
|
||||
{
|
||||
c->geo.x = W->screen->ugeo.w - (c->geo.x + c->geo.w);
|
||||
client_moveresize(c, c->geo);
|
||||
client_moveresize(c, &c->geo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,6 +311,6 @@ uicb_layout_hmirror(Uicb cmd)
|
||||
SLIST_FOREACH(c, &W->screen->seltag->clients, tnext)
|
||||
{
|
||||
c->geo.y = W->screen->ugeo.h - (c->geo.y + c->geo.h);
|
||||
client_moveresize(c, c->geo);
|
||||
client_moveresize(c, &c->geo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,6 +108,7 @@ struct tag
|
||||
{
|
||||
struct screen *screen;
|
||||
struct client *sel;
|
||||
struct client *prevsel;
|
||||
char *name;
|
||||
Flags flags;
|
||||
Window frame;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user