NativeWindow focus after activate()

Hi guys, I was wondering…

I’ve got a NativeWindow that I open from a systemtray/dock icon (it’s a custom styled menu)

The window needs to close when the user clicks outside the window, so I used Event.DEACTIVATE to hide the menu window.

This only works when I’ve clicked inside the window once, but it doesn’t work when the window hasn’t got focus yet…

How can I open (activate) a NativeWindow and set the focus to the window so clicking outside will trigger Event.DEACTIVATE?