[dev] [PATCH] wmii - client mapping events

From: Suraj Kurapati <sunaku_AT_gmail.com>
Date: Sun, 27 Mar 2011 01:04:09 -0700

Hello,

The following patch against wmii-hg r2785 allows my wmiirc to know
when clients are added to or removed from the current view. Using
that information it can persist[1] the application of automated client
arrangements (such as emulating LarsWM tiling layout, for example) as
the current view's population changes over time.

diff -r 327e87c7bb2b cmd/wmii/client.c
--- a/cmd/wmii/client.c Thu Oct 28 09:55:54 2010 -0400
+++ b/cmd/wmii/client.c Sun Mar 27 00:48:51 2011 -0700
@@ -492,14 +492,17 @@
 client_map(Client *c) {
         if(!c->w.mapped) {
                 mapwin(&c->w);
+ event("MapClient %#C\n", c);
                 client_setstate(c, NormalState);
         }
 }

 void
 client_unmap(Client *c, int state) {
- if(c->w.mapped)
+ if(c->w.mapped) {
                 unmapwin(&c->w);
+ event("UnmapClient %#C\n", c);
+ }
         client_setstate(c, state);
 }

Also, note that only those mapping events that occur (1) after the
first subsequent ClientFocus event and (2) before the next UnfocusTag
event correspond to clients added to and removed from the current
view. Mapping events which occur outside the mentioned boundaries are
transient (occurring while a view is being switched to).

Cheers.

[1]: https://github.com/sunaku/wmiirc/commit/6b9ef9c0727a66f02afe975195d1b8ff0b9ad8d4
Received on Sun Mar 27 2011 - 10:04:09 CEST

This archive was generated by hypermail 2.2.0 : Sun Mar 27 2011 - 10:12:03 CEST