diff --git a/cmd/wmii/bar.c b/cmd/wmii/bar.c index e2a3e6c5..6613c141 100644 --- a/cmd/wmii/bar.c +++ b/cmd/wmii/bar.c @@ -11,16 +11,11 @@ static Handlers handlers; for((b)=(s)->bar[__bar_n]; (b); (b)=(b)->next) void -bar_init(WMScreen *s, bool force) { +bar_init(WMScreen *s) { WinAttr wa; - if(s->barwin) - if(force) - destroywindow(s->barwin); - else { - bar_resize(s); - return; - } + if(s->barwin && (s->barwin->depth == 32) == s->barwin_rgba) + return; s->brect = s->r; s->brect.min.y = s->brect.max.y - labelh(def.font); @@ -182,12 +177,12 @@ bar_draw(WMScreen *s) { width += tw * shrink; } + if(s->bar[BRight]) + s->bar[BRight]->r.max.x += Dx(s->brect) - width; tb = nil; foreach_bar(s, b) { if(tb) b->r = rectaddpt(b->r, Pt(tb->r.max.x, 0)); - if(b == s->bar[BRight]) - b->r.max.x += Dx(s->brect) - width; tb = b; } @@ -206,7 +201,7 @@ bar_draw(WMScreen *s) { } if(s->barwin_rgba != (s->barwin->depth == 32)) - bar_init(s, true); + bar_init(s); copyimage(s->barwin, r, ibuf, ZP); } diff --git a/cmd/wmii/fns.h b/cmd/wmii/fns.h index 0f2dfac6..aa8fd136 100644 --- a/cmd/wmii/fns.h +++ b/cmd/wmii/fns.h @@ -68,7 +68,7 @@ Bar* bar_create(Bar**, const char*); void bar_destroy(Bar**, Bar*); void bar_draw(WMScreen*); Bar* bar_find(Bar*, const char*); -void bar_init(WMScreen*, bool); +void bar_init(WMScreen*); void bar_resize(WMScreen*); void bar_sety(WMScreen*, int); void bar_setbounds(WMScreen*, int, int); diff --git a/cmd/wmii/main.c b/cmd/wmii/main.c index ff1b600f..2c0d26b5 100644 --- a/cmd/wmii/main.c +++ b/cmd/wmii/main.c @@ -210,7 +210,7 @@ init_screens(void) { for(v=view; v; v=v->next) view_init(v, i); def.snap = Dy(screen->r) / 63; - bar_init(screens[i], false); + bar_init(screens[i]); } screen = screens[0]; if(selview) diff --git a/cmd/wmii/root.c b/cmd/wmii/root.c index ee64a2e9..1643f145 100644 --- a/cmd/wmii/root.c +++ b/cmd/wmii/root.c @@ -10,16 +10,15 @@ void root_init(void) { WinAttr wa; + wa.cursor = cursor[CurNormal]; wa.event_mask = EnterWindowMask | FocusChangeMask | LeaveWindowMask | PointerMotionMask | SubstructureNotifyMask | SubstructureRedirectMask; - wa.cursor = cursor[CurNormal]; - setwinattr(&scr.root, &wa, - CWEventMask - | CWCursor); + setwinattr(&scr.root, &wa, CWCursor + | CWEventMask); sethandler(&scr.root, &handlers); } @@ -50,16 +49,8 @@ static bool mapreq_event(Window *w, void *aux, XMapRequestEvent *e) { XWindowAttributes wa; - if(!XGetWindowAttributes(display, e->window, &wa)) + if(!XGetWindowAttributes(display, e->window, &wa) || wa.override_redirect) return false; - if(wa.override_redirect) { - /* Do I really want these? */ - /* Probably not. - XSelectInput(display, e->window, - PropertyChangeMask | StructureNotifyMask); - */ - return false; - } if(!win2client(e->window)) client_create(e->window, &wa); return false; diff --git a/lib/libstuff/x11/initdisplay.c b/lib/libstuff/x11/initdisplay.c index b8a21789..069c8af4 100644 --- a/lib/libstuff/x11/initdisplay.c +++ b/lib/libstuff/x11/initdisplay.c @@ -22,7 +22,7 @@ static int Lfmt(Fmt *f) { Color c; -#define fix(c, m) (ushort)((c.alpha ? ((ulong)c.m * 0xffff) / c.alpha : 0) >> 8) +#define fix(c, m) (ushort)((c.alpha ? (ulong)c.m * 0xffff / c.alpha : 0) >> 8) c = va_arg(f->args, Color); return fmtprint(f, c.alpha < 0xff00 ? "rgba:%02uhx/%02uhx/%02uhx/%02uhx" : "#%02uhx%02uhx%02uhx",