wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit c4e7c2de671adacac0115425eadb5721867ff325
parent a50e6e42acd09c2b55bbad42595ed837f54fa6e1
Author: Kris Maglione <kris@suckless.org>
Date:   Thu, 27 May 2010 18:05:27 -0400

Allow _NET_ACTIVE_WINDOW requests from clients, if they have recent user activity. Rationale:

I don't like allowing clients to activate windows, because they
usually seem to do it for annoying reasons. However, system tray
icons usually activate their main windows when clicked, which is
what the user expects. So, as a comprimise, only allow the action if
the user has recently interacted with them.

Diffstat:
cmd/wmii/dat.h | 6++++++
cmd/wmii/ewmh.c | 4+++-
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/cmd/wmii/dat.h b/cmd/wmii/dat.h @@ -36,6 +36,12 @@ enum { UrgClient, }; +enum { + SourceUnknown, + SourceClient, + SourcePager +}; + enum EWMHType { TypeDesktop = 1<<0, TypeDock = 1<<1, diff --git a/cmd/wmii/ewmh.c b/cmd/wmii/ewmh.c @@ -378,7 +378,9 @@ ewmh_clientmessage(XClientMessageEvent *e) { if(c == nil) return 1; Dprint(DEwmh, "\tclient: %C\n", c); - if(l[0] != 2) + if(l[0] == SourceClient && abs(event_xtime - l[1]) > 5000) + return 1; + if(l[0] != SourceClient && l[0] != SourcePager) return 1; focus(c, true); return 1;