wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit e8741feda4fca83d51ffd04f6d9f1a1a78355b55
parent b0fc54d6fab19629a155e8a9009efdd272728c7d
Author: Kris Maglione <jg@suckless.org>
Date:   Sat, 11 Oct 2008 22:09:21 -0400

More xinerama stuff

Diffstat:
cmd/wmii/bar.c | 6+++++-
cmd/wmii/main.c | 23+++++++++++++----------
cmd/wmii/xext.c | 1+
3 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/cmd/wmii/bar.c b/cmd/wmii/bar.c @@ -44,7 +44,11 @@ bar_resize(WMScreen *s) { s->brect = s->r; s->brect.max.y = labelh(def.font); - view_update(screen->sel); + /* Not guarangeed to exist on xinerama displays, for the + * moment; + */ + if(screen->sel) + view_update(screen->sel); } void diff --git a/cmd/wmii/main.c b/cmd/wmii/main.c @@ -154,28 +154,31 @@ ErrorCode ignored_xerrors[] = { void init_screens(void) { Rectangle *rects; + static Image *ibuf, *ibuf32; int i, n, m; rects = xinerama_screens(&n); m = max(n, num_screens); - screens = erealloc(screens, m * sizeof *screens); for(i=num_screens; i < m; i++) screens[i] = (WMScreen){ 0, }; - num_screens = m; + freeimage(ibuf); + freeimage(ibuf32); + ibuf = allocimage(Dx(scr.rect), Dy(scr.rect), scr.depth); + ibuf32 = nil; /* Probably shouldn't do this until it's needed. */ + if(render_visual) + ibuf32 = allocimage(Dx(scr.rect), Dy(scr.rect), 32); + for(i=0; i < n; i++) { screen = &screens[i]; - screen->r = scr.rect; - def.snap = Dy(scr.rect) / 63; - freeimage(screen->ibuf); - freeimage(screen->ibuf32); - screen->ibuf = allocimage(Dx(screen->r), Dy(screen->r), scr.depth); - /* Probably shouldn't do this until it's needed. */ - if(render_visual) - screen->ibuf32 = allocimage(Dx(screen->r), Dy(screen->r), 32); + print("rects[%d]: %R\n", i, rects[i]); + screen->r = rects[i]; + def.snap = Dy(rects[i]) / 63; + screen->ibuf = ibuf; + screen->ibuf32 = ibuf32; bar_init(screen); } diff --git a/cmd/wmii/xext.c b/cmd/wmii/xext.c @@ -158,6 +158,7 @@ xinerama_screens(int *np) { rects[i].max.y = res[i].y_org + res[i].height; } + print("have_xinerama: true; n: %d\n", n); *np = n; return rects; }