[xmonad] Issue 143 in xmonad: XEvent hook or similar needed

codesite-noreply at google.com codesite-noreply at google.com
Fri Feb 29 08:24:37 EST 2008


Issue 143: XEvent hook or similar needed
http://code.google.com/p/xmonad/issues/detail?id=143

Comment #10 by Braden.Shepherdson:
Part of the question is speed; if every event gets run through a list 
of such
handlers, it seems like the majority of the events will end up back in 
the hands of
Main's handle function. I don't know how frequently events arrive.

Maybe use pattern matching? Rename the existing handle to handle', the 
new handle
tries the user's messageHook (:: Event -> X Bool, pattern matching like 
handle but
indicating whether handle' should still process the event), and if the 
response is
False, try it with handle'. I'm not sure how pattern matching would compare
speed-wise with a list. It also enforces only one handler per event, 
which I think
might be desirable.

Whatever solution is settled on, I think it's desirable to have type -> 
X Bool, so
the user's message handlers can either eat the event, or leave it to be 
processed as
normal. That opens up the ability for extensions to observe events 
without consuming
them.

And as a use case other than EWMH: timers. The current Util.Timer 
module only works
for LayoutModifiers, because only they can handleMessage right now. 
Instead, this
module could just offer a handleTimer to use in messageHook, and then 
we have
general-purpose timers.



-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


More information about the xmonad mailing list