Thoughts on Wimp event handling

There are several aspects of this that I don't like.  Too much use is made of
'catch-all' type handlers which deal with any occurance of certain event and
then find out which window it applied to and what to do about it.  This
has the side effect of leading to some huge functions which are hard to
follow.  IMHO it's better to make event handlers more specific (certainly
specific to a certain window if not to particular icons) - this leads to
smaller, simpler functions and allows better partitioning and separation of
the code into e.g. mount related stuff, filer related stuff etc.

Another thing that's particularly nasty is the way a 'catch all' event
handler is registered per mount for each event.  Each time an event occurs to
do with a particular mount, you might cycle through several instances of the
same event handler before you match the one for the mount you're interested
in (it does this match using the 'user data' pointer).

This is completely pointless: either register a *single* non-window or icon
specific event handler that is used for all mounts, then decode which
particular mount the event occurred on at the start of the handler (i.e.
trust the value of the global variable it currently compares the user data
pointer against when cycling through them), or register multiple window and
icon specific handlers (possibly using the same handler routine) and trust
your user data pointer to give you appropriate context.