How can I tell if my ToolWindow loses focus?

That is, I want to know when it becomes hidden or the editor gets the focus.

I looked at the API and didn't find anything that would let me add a "toolWindowFocusListner" to get such events.

Any help is appreciated -- thanks in advance.