[xmonad] Issue 19 in xmonad: Investigate a way to allow contrib extensions to use compositing.

codesite-noreply at google.com codesite-noreply at google.com
Mon Jul 27 02:13:13 EDT 2009


Comment #17 on issue 19 by amdragon: Investigate a way to allow contrib  
extensions to use compositing.
http://code.google.com/p/xmonad/issues/detail?id=19

> The advantage of handleEventHook is that you also receive events that  
> would otherwise
> be handled by xmonad.

Ah, that makes sense.  I suppose it doesn't help much in the compositing  
case because
I don't think those messages are caught by xmonad, but I can see it being  
useful for
other things.

> I don't know what you mean by actions not having a way to receive Events

I didn't mean to say it was impossible to receive Events from actions, just
difficult.  From a user's perspective, all you want to do is bind the  
action to a key
and be done with it.  But this doesn't work.

1) Instead of implementing your action as an action, you can implement it  
as a layout
modifier (ala XMonad.Hooks.EventHook).  Now your action is a layout, which  
is weird,
and the user has to both bind the action to a key and, for some mysterious  
reason,
wrap their layout hook.

2) Using handleEventHook, you can implement your action as an action, plus  
an event
hook.  If you're handling events you almost certainly also need state,  
which means
you also need something to create the IORef.  Now the user has to "create"  
the
action, bind it to a key, /and/ modify their handleEventHook.

3) You can have your own event loop (ala XMonad.Prompt).  Now your action  
is just an
action and the user can just bind it to a key like they wanted, but you  
don't play
well with others.  At best, you delay messages, which could be bad if its a  
damage or
timer event aimed at another event handler trying to do compositing or  
animation.  At
worst you eat them.  Ever noticed what happens to  
XMonad.Layout.Decoration's that are
under an XMonad.Prompt or its completions window?  The prompt eats expose  
events, so
the title bars get wiped out and stay wiped out after the prompt closes.   
Again,
imagine if you were eating damage or timer events.

Anyways.  This is mostly intended as food for thought: things that are  
going to come
up if/when someone starts working on compositing.

--
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