Going from an nsIXULWindow to a <window>

David Ascher <[email protected]> Fri, 06 Jun 2003 12:45:51 -0700
Newsgroups gmane.comp.mozilla.devel.xpfe,gmane.comp.mozilla.devel.xpcom
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
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