[hackers] [wmii] Add ViewAttach, ViewDetach, AreaAttach, and AreaDetach events. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Thu, 21 Apr 2011 15:07:26 +0200 (CEST)

changeset: 2786:f93fd217b7fb
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Thu Apr 21 09:07:19 2011 -0400
files: alternative_wmiircs/python/wmiirc.py cmd/menu/menu.c cmd/wmii/area.c cmd/wmii/view.c
description:
Add ViewAttach, ViewDetach, AreaAttach, and AreaDetach events.

diff -r 327e87c7bb2b -r f93fd217b7fb alternative_wmiircs/python/wmiirc.py
--- a/alternative_wmiircs/python/wmiirc.py Thu Oct 28 09:55:54 2010 -0400
+++ b/alternative_wmiircs/python/wmiirc.py Thu Apr 21 09:07:19 2011 -0400
@@ -309,7 +309,7 @@
                    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)
 
diff -r 327e87c7bb2b -r f93fd217b7fb cmd/menu/menu.c
--- a/cmd/menu/menu.c Thu Oct 28 09:55:54 2010 -0400
+++ b/cmd/menu/menu.c Thu Apr 21 09:07:19 2011 -0400
@@ -76,10 +76,8 @@
         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;
 }
 
diff -r 327e87c7bb2b -r f93fd217b7fb cmd/wmii/area.c
--- a/cmd/wmii/area.c Thu Oct 28 09:55:54 2010 -0400
+++ b/cmd/wmii/area.c Thu Apr 21 09:07:19 2011 -0400
@@ -254,6 +254,7 @@
                 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 @@
         a = f->area;
         v = a->view;
 
+ event("AreaDetach %s %a %#C\n", v->name, a, f->client);
         if(a->floating)
                 float_detach(f);
         else
diff -r 327e87c7bb2b -r f93fd217b7fb cmd/wmii/view.c
--- a/cmd/wmii/view.c Thu Oct 28 09:55:54 2010 -0400
+++ b/cmd/wmii/view.c Thu Apr 21 09:07:19 2011 -0400
@@ -391,6 +391,7 @@
         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 @@
         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))
Received on Thu Apr 21 2011 - 15:07:26 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 21 2011 - 15:12:05 CEST