Re: Project idea on "Big one hook"



On Tuesday 29 September 2009 10:35:02 Teika Kazura wrote:
> I myself have experienced similar at least three times, both in focus
> and stacking. Isn't it a problem or what? :)

Is it a problem that could be solved by having more control over the 
order in which members of a hook are invoked? 

> It's unsound that no one knows exactly what happens internally,
> especially when a window is added and mapped.

I think that is the sound situation.  It allows for more modular code.  
A module neither knows nor cares what other modules do in the same 
hooks.  The hook mechanism is such a great idea that it has been 
reinvented time and again: Boost and Qt have signals, Java has 
observers.

Note that it is essential that modules don't need to care what others 
do.  If invocation order of hooks becomes important, there is a problem.  
The simplest solution is splitting the hook in stages, i.e., several 
hooks that are called in sequence.

> (For example, it must be likely that someone wants to override
> matcher's action. Then it must be done after matcher.)

You could append your hook function to before-add-window-hook, but you 
would have do that after match-window has been loaded (because it also 
appends).  So it would be safer to use a later hook, perhaps
add-window-hook.  Why was it deprecated?  A lot of code still uses it.

-- 
	Timo Korvola		<URL:http://www.iki.fi/tkorvola>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]