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

This commit is contained in:
Kris Maglione 2007-02-10 02:44:57 -05:00
parent 3cb772c951
commit d197845630
3 changed files with 13 additions and 14 deletions

1
area.c
View File

@ -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);

View File

@ -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

6
view.c
View File

@ -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