Permalink
Browse files

Add ViewAttach, ViewDetach, AreaAttach, and AreaDetach events.

  • Loading branch information...
Kris Maglione
Kris Maglione committed Apr 21, 2011
1 parent eab1ad5 commit 3fbb8695490d40db1853e666682ba4596790f64d
Showing with 7 additions and 5 deletions.
  1. +1 −1 alternative_wmiircs/python/wmiirc.py
  2. +2 −4 cmd/menu/menu.c
  3. +2 −0 cmd/wmii/area.c
  4. +2 −0 cmd/wmii/view.c
@@ -309,7 +309,7 @@ def addresize(mod, desc, cmd, *args):
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
@@ -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
@@ -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
@@ -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))

0 comments on commit 3fbb869

Please sign in to comment.