[dev] Re: [PATCH] wmii - client mapping events

From: Suraj Kurapati <sunaku_AT_gmail.com>
Date: Sat, 2 Apr 2011 00:45:14 -0700

On Mon, Mar 28, 2011 at 3:53 PM, Suraj Kurapati <sunaku_AT_gmail.com> wrote:
> On Sun, Mar 27, 2011 at 1:04 AM, Suraj Kurapati <sunaku_AT_gmail.com> wrote:
>> The following patch against wmii-hg r2785 allows my wmiirc to know
>> when clients are added to or removed from the current view.
>
> Here is an updated patch that [...] fires those events only when the
> current view is actually changed.  No need for special logic to detect
> valid boundaries of MapClient and UnmapClient events.

Here is another updated patch that also deals with moving clients from
the floating layer to the managed layer and vice versa. The two
events from before have been reduced to a single "ArrangeView" event
that is emitted with no arguments. Cheers.

diff -r 327e87c7bb2b cmd/wmii/area.c
--- a/cmd/wmii/area.c Thu Oct 28 09:55:54 2010 -0400
+++ b/cmd/wmii/area.c Sat Apr 02 00:41:37 2011 -0700
@@ -218,6 +218,10 @@

         area_detach(f);

+ if(from->floating ^ to->floating)
+ event("ArrangeView\n");
+
         /* Temporary kludge. */
         if(!to->floating
         && to->floating != from->floating
diff -r 327e87c7bb2b cmd/wmii/view.c
--- a/cmd/wmii/view.c Thu Oct 28 09:55:54 2010 -0400
+++ b/cmd/wmii/view.c Sat Apr 02 00:41:37 2011 -0700
@@ -416,6 +416,10 @@
         if(c->sel == nil)
                 c->sel = f;
         view_update(v);
+
+ if (v == selview && !a->floating)
+ event("ArrangeView\n");
 }

 void
@@ -426,6 +430,10 @@
         v = f->view;
         c = f->client;

+ if (v == selview && !f->area->floating)
+ event("ArrangeView\n");
+
         area_detach(f);
         if(c->sel == f)
                 c->sel = f->cnext;
Received on Sat Apr 02 2011 - 09:45:14 CEST

This archive was generated by hypermail 2.2.0 : Sat Apr 02 2011 - 09:48:02 CEST