I'm trying to simulate the notion of 'application focus' (e.g. what
windows sends WM_ACTIVATEAPP for) in a mozilla app by hooking up event
listeners for focus and blur events on all windows created by the
Mozilla engine. My plan was to register a listener with the
nsIWindowMediator, register event listeners with those windows as they
are created, and keep track of who'se got the focus and when.
I'm stumped because nsIWindowMediatorListeners get sent nsIXULWindow
objects, from which I don't know how to get to the XUL window or the
document, so that I can add an event listener.
I've noticed that Venkman has code to go from a window object to its
nsIXULWindow
(http://lxr.mozilla.org/seamonkey/source/extensions/venkman/resources/content/venkman-utils.js#542),
but haven't found the reverse.
Any ideas?
--david ascher
