Add ViewAttach, ViewDetach, AreaAttach, and AreaDetach events.

This commit is contained in:
Kris Maglione 2011-04-21 09:07:19 -04:00
parent 82e93cb5f2
commit a2f9088245
4 changed files with 7 additions and 5 deletions

View File

@ -309,7 +309,7 @@ if not os.environ.get('WMII_NOPLUGINS', ''):
reduce(operator.add, map(os.listdir, dirs), []))
for f in ['wmiirc_local'] + ['plugins.%s' % file[:-3] for file in files]:
try:
exec 'import %s' % f
__import__(f)
except Exception, e:
traceback.print_exc(sys.stdout)

View File

@ -76,10 +76,8 @@ slice(Rectangle *rp, int x, int y) {
Rectangle r;
r = *rp;
if(x)
rp->min.x += x, r.max.x = min(rp->min.x, rp->max.x);
if(y)
rp->min.y += y, r.max.y = min(rp->min.y, rp->max.y);
if(x) rp->min.x += x, r.max.x = min(rp->min.x, rp->max.x);
if(y) rp->min.y += y, r.max.y = min(rp->min.y, rp->max.y);
return r;
}

View File

@ -254,6 +254,7 @@ area_attach(Area *a, Frame *f) {
column_attach(a, f);
view_arrange(a->view);
event("AreaAttach %s %a %#C\n", a->view->name, a, f->client);
if(btassert("4 full", a->frame && a->sel == nil))
a->sel = a->frame;
@ -267,6 +268,7 @@ area_detach(Frame *f) {
a = f->area;
v = a->view;
event("AreaDetach %s %a %#C\n", v->name, a, f->client);
if(a->floating)
float_detach(f);
else

View File

@ -391,6 +391,7 @@ view_attach(View *v, Frame *f) {
if(!a->floating && c->floating != Never && view_fullscreen_p(v, a->screen))
a = v->floating;
event("ViewAttach %s %#C\n", v->name, c);
area_attach(a, f);
/* TODO: Decide whether to focus this frame */
bool newgroup = !c->group
@ -430,6 +431,7 @@ view_detach(Frame *f) {
if(c->sel == f)
c->sel = f->cnext;
event("ViewDetach %s %#C\n", v->name, c);
if(v == selview)
view_update(v);
else if(empty_p(v))