JDK-4940253 : Popup window is not shown on Linux/Gnome in tests automated by Jemmy
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P1
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: solaris_7
  • CPU: sparc
  • Submitted: 2003-10-20
  • Updated: 2003-11-25
  • Resolved: 2003-11-25
Related Reports
Relates :  
Description
Popup window is not shown even the proper event is delivered to a responsible component. It happens only on Linux/Gnome with JDK1.5.0-beta (lastly tested on b24). It blocks majority of automated tests of NetBeans IDE which use Jemmy library. To reproduce:

- download jemmy.jar from http://jemmy.netbeans.org/downloads.html
- download attached testPopup.zip
- run e.g. like this: java -cp /tmp/jemmy.jar:testPopup.zip TestPopup15

You will see a frame with JTextArea in it. The text area has a simple popup associated with it. If you run it on a different JDK than 1.5, it will several times open a dialog by popup menu. But on JDK1.5 it will stop waiting on popup window to show. At the standard output you can see an event last delivered to the text area. The test will time out in 60 seconds.

Comments
SUGGESTED FIX Name: azC76091 Date: 10/28/2003 ------- BasicPopupMenuUI.java ------- *** /tmp/sccs.93aann Mon Oct 27 16:18:22 2003 --- BasicPopupMenuUI.java Mon Oct 27 15:40:23 2003 *************** *** 796,802 **** } public void componentResized(ComponentEvent e) { ! cancelPopupMenu(); } public void componentMoved(ComponentEvent e) { cancelPopupMenu(); --- 796,813 ---- } public void componentResized(ComponentEvent e) { ! // Repaint all the popups in MenuSelectedPath to get ! // sure that they will be painted properly after component's resize ! JPopupMenu firstPopup = (JPopupMenu)getFirstPopup(); ! List popups = getPopups(); ! Iterator iter = popups.iterator(); ! while (iter.hasNext()) { ! JPopupMenu popup = (JPopupMenu)iter.next(); ! Component invok = popup.getInvoker(); ! java.awt.Point p = popup.getLocationOnScreen(); ! SwingUtilities.convertPointFromScreen(p, invok); ! popup.show(popup.getInvoker(), p.x, p.y); ! } } public void componentMoved(ComponentEvent e) { cancelPopupMenu(); ======================================================================
24-08-2004

EVALUATION Name: azC76091 Date: 10/28/2003 The source of this problem is in fact that some of the events generated by the test suite caused X11 toolkit to post COMPONENT_RESIZED events. The popup appears for a moment and disappears instantly when his mouse and component event listener receives event that invoker's frame was resized. It is reproducible on any *nix platform if test launched with the XToolkit. On Linux it reproducible because XToolkit is default AWT toolkit on Linux (as MToolkit on Solaris). The idea of suggested fix is to call show() for all the popups in the menu selection path to force them to be redrawn and their type (lightweight, heavyweight) to be adjusted according the new parent component's size. ###@###.### 10/28/2003 ====================================================================== Name: azR10139 Date: 11/25/2003 As the AWT team fixed the source of this problem and we do not receiving the extra events there is no need to make such a risky changes in swing toolkit. See AWT bug 4942457: XToolkit: calling toFront() on Frame generates unexpected COMPONENT_RESIZED even for more details. Closing this bug as not reproducible. ###@###.### 11/25/2003 ======================================================================
25-11-2003