mirror of https://github.com/0intro/wmii
Fix crash. Fix botched gravity handling. Fix fullscreen.
This commit is contained in:
parent
ed71c6eea9
commit
449df09d6b
|
@ -220,18 +220,17 @@ gravclient(Client *c, Rectangle rd) {
|
|||
r = c->sel->r;
|
||||
else
|
||||
r = c->sel->revert;
|
||||
r = gravitate(r, c->w.r, h->grav);
|
||||
r = gravitate(c->w.r, r, h->grav);
|
||||
if(h->gravstatic)
|
||||
r = rectaddpt(r, sp);
|
||||
r = frame2client(nil, r);
|
||||
return r;
|
||||
}else {
|
||||
r = client2frame(c->sel, c->w.r);
|
||||
r = gravitate(rd, r, h->grav);
|
||||
r = client2frame(nil, rd);
|
||||
r = gravitate(r, rd, h->grav);
|
||||
if(h->gravstatic)
|
||||
r = rectsubpt(r, sp);
|
||||
r = client2frame(nil, r);
|
||||
return r;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
Rectangle
|
||||
|
@ -608,7 +607,7 @@ wmname:
|
|||
/* Handlers */
|
||||
static void
|
||||
configreq_event(Window *w, XConfigureRequestEvent *e) {
|
||||
Rectangle r;
|
||||
Rectangle r, cr;
|
||||
Frame *f;
|
||||
Client *c;
|
||||
|
||||
|
@ -631,9 +630,10 @@ configreq_event(Window *w, XConfigureRequestEvent *e) {
|
|||
c->border = e->border_width;
|
||||
|
||||
r.max = addpt(r.min, r.max);
|
||||
cr = r;
|
||||
r = gravclient(c, r);
|
||||
|
||||
if((Dx(r) == Dx(screen->r)) && (Dy(r) == Dy(screen->r)))
|
||||
if((Dx(cr) == Dx(screen->r)) && (Dy(cr) == Dy(screen->r)))
|
||||
fullscreen(c, True);
|
||||
|
||||
if(c->sel->area->floating)
|
||||
|
@ -866,7 +866,7 @@ apply_tags(Client *c, const char *tags) {
|
|||
cur = nil;
|
||||
if(!strcmp(buf+n, "~"))
|
||||
c->floating = add;
|
||||
else if(!strcmp(buf+n, "!") || strcmp(buf+n, "sel"))
|
||||
else if(!strcmp(buf+n, "!") || !strcmp(buf+n, "sel"))
|
||||
cur = screen->sel->name;
|
||||
else if(!Mbsearch(buf+n, badtags, bsstrcmp))
|
||||
cur = buf+n;
|
||||
|
|
|
@ -113,6 +113,7 @@ XRectangle XRect(Rectangle r);
|
|||
#define Pt(x, y) ((Point){(x), (y)})
|
||||
#define Rpt(p, q) ((Rectangle){p, q})
|
||||
#define Rect(x0, y0, x1, y1) ((Rectangle){Pt(x0, y0), Pt(x1, y1)})
|
||||
#define changeprop(w, prop, type, data, n) changeproperty(w, prop, type, ((sizeof(*(data)) == 8 ? 4 : sizeof(*(data))) \
|
||||
* 8), \
|
||||
(uchar*)(data), n)
|
||||
#define changeprop(w, prop, type, data, n) \
|
||||
changeproperty(w, prop, type, \
|
||||
((sizeof(*(data)) == 8 ? 4 : sizeof(*(data))) * 8), \
|
||||
(uchar*)(data), n)
|
||||
|
|
Loading…
Reference in New Issue