<AWT Dev> WINDOW_LOST_FOCUS event not fired on gnome
Severin Gehwolf
sgehwolf at redhat.com
Mon Jun 15 15:30:14 UTC 2015
Hi,
Please see the attached reproducer which listens for an
WINDOW_LOST_FOCUS event on a dialog with a frame as parent. Once the
dialog is disposed I'd expect a WINDOW_LOST_FOCUS event being fired[1]
before a WINDOW_CLOSED event. However, this doesn't seem to be the case
sometimes. Example output:
--------------------- RUNNING TEST -------------------
got WINDOW_GAINED_FOCUS event on dialog
---> calling dialog1 dispose
correctly got WINDOW_LOST_FOCUS event on dialog
dialog closed
Test passed
--------------------- RUNNING TEST -------------------
got WINDOW_GAINED_FOCUS event on dialog
---> calling dialog1 dispose
correctly got WINDOW_LOST_FOCUS event on dialog
dialog closed
Test passed
--------------------- RUNNING TEST -------------------
got WINDOW_GAINED_FOCUS event on dialog
---> calling dialog1 dispose
Exception in thread "main" dialog closed
Test failed
java.lang.RuntimeException: Test failed
at WindowLostFocusReproducer.main(WindowLostFocusReproducer.java:26)
So the event gets fired twice correctly, but on the third iteration this
event isn't fired. I've tested this on Fedora 21 with gnome-shell
3.14.4-2.fc21, F22 with gnome-shell 3.16 and on RHEL 6 with gnome 2.28.2
All of them seem to be affected. Is this a bug or a feature? Any
thoughts as to how to debug events?
This happens with both, an OpenJDK 8u45 and a recent OpenJDK 9 build.
Thanks,
Severin
[1] https://docs.oracle.com/javase/tutorial/uiswing/events/windowlistener.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WindowLostFocusReproducer.java
Type: text/x-java
Size: 3833 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20150615/361c3371/WindowLostFocusReproducer.java>
More information about the awt-dev
mailing list