wmii

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

commit d1978456306b2be3fb2e1930b6b5df00630112b5
parent 3cb772c951191d2159f08a9823c82c4210cfa4dd
Author: Kris Maglione <jg@suckless.org>
Date:   Sat, 10 Feb 2007 02:44:57 -0500

Remove some cruft, arrange areas when adding clients, and make sure we don't map mapped clients and vice versa


Diffstat:
area.c | 1+
client.c | 20++++++++++++--------
view.c | 6------
3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/area.c b/area.c @@ -155,6 +155,7 @@ attach_to_area(Area *a, Frame *f, Bool send) { else /* floating */ place_client(a, c); + arrange_column(a, False); focus_client(f->client, False); update_client_grab(f->client); diff --git a/client.c b/client.c @@ -220,22 +220,26 @@ set_client_state(Client * c, int state) void map_client(Client *c) { - XSelectInput(blz.dpy, c->win, CLIENT_MASK & ~StructureNotifyMask); - XMapWindow(blz.dpy, c->win); - XSelectInput(blz.dpy, c->win, CLIENT_MASK); + if(!c->mapped) { + XSelectInput(blz.dpy, c->win, CLIENT_MASK & ~StructureNotifyMask); + XMapWindow(blz.dpy, c->win); + XSelectInput(blz.dpy, c->win, CLIENT_MASK); + } set_client_state(c, NormalState); c->mapped = 1; } void unmap_client(Client *c, int state) { - XSelectInput(blz.dpy, c->win, CLIENT_MASK & ~StructureNotifyMask); - XUnmapWindow(blz.dpy, c->win); - XSelectInput(blz.dpy, c->win, CLIENT_MASK); + if(c->mapped) { + XSelectInput(blz.dpy, c->win, CLIENT_MASK & ~StructureNotifyMask); + XUnmapWindow(blz.dpy, c->win); + XSelectInput(blz.dpy, c->win, CLIENT_MASK); + /* Always set this, since we don't care anymore once it's been destroyed */ + c->unmapped++; + } set_client_state(c, state); c->mapped = 0; - /* Always set this, since we don't care anymore once it's been destroyed */ - c->unmapped++; } void diff --git a/view.c b/view.c @@ -153,7 +153,6 @@ void attach_to_view(View *v, Frame *f) { Area *a; Client *c = f->client; - unsigned int i; c->revert = nil; a = v->sel; @@ -163,11 +162,6 @@ attach_to_view(View *v, Frame *f) { else if(starting && v->sel->floating) v->sel = v->area->next; attach_to_area(v->sel, f, False); - if(a != v->sel) { - for(a=v->area, i = 0; a && a != v->sel; a=a->next, i++); - if(i) write_event("ColumnFocus %d\n", i); - else write_event("FocusFloating\n"); - } } void