Config: Linux + Sawfish/Enligntenment + jdk 1.3.1_01
WINDOW_DEACTIVATED and WINDOW_ACTIVATED events are expected to be fired when the
user switches the focus from/to an AWT Frame. This does not happen if the user uses Alt+TAB
to do the switching. This causes a significant problem for Forte for Java/NetBeans IDE.
See the IDE bug description at
http://www.netbeans.org/issues/show_bug.cgi?id=16755
After playing with xev utility and studying JDK source code I conclude
that this is a bug in JDK. XEvent of FocusIn/FocusOut type
is mapped and routed to java.awt.Window iff xev->mode == NotifyNormal,
which does not hold when switching b/w native windows using Alt+Tab.
For jdk 1.3.1 we can work around the bug by hooking into AWTEvent queue
(using AWTEventListener) and react to FOCUS_GAINED event. The hack is
extremely ugly but it works. On JDK 1.4 beta3 even FOCUS_GAINED is not
fired so we are out of luck.
Although the testing environment is Linux + Sawfish, I suspect that the same
defect is present on Solaris+CDE