JDK-4452349 : Popup: Hides behind the app over which it appeared, on a mouse move operation
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: solaris_7
  • CPU: sparc
  • Submitted: 2001-04-30
  • Updated: 2002-05-22
  • Resolved: 2002-05-17
Related Reports
Relates :  
Description
1. Run the application pasted below.
2. Make sure that the Popup appears over an active application. I brought the Popup over the terminal window from which I was running. That way the terminal will be active when the Popup appears.
3. The Popup has a JComboBox on it with setPopupVisible set to true.
4. When the Popup appears, the application over which it showed up is still seen active. Now click the button part, not the drop-down list.
5. Move the mouse away from the Popup area.
6. The Popup goes behind the active application.

% java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b62)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b62, mixed mode)

Found happening in: Solaris Sparc and Solaris X86 machines. The behaviour in Linux & Windows machines differ & are explained below:
Linux: The active app becomes inactive & Popup becomes the active app. So it does not go behind the app over which it appeared.
Windows: The active app remains so even after the arrival of Popup, but once the Popup is clicked, the Popup becomes the active app and so it does not go behind the app over which it is launched.

Finding: The behaviour of the Popup remains the same with any swing component over it.

Code used:
import java.awt.*;
import java.util.*;
import javax.swing.*;
import java.awt.event.*;

public class HeavyPopTest04 {
  private Popup popup;
  private PopupFactory pFactory;
  private JComboBox combo;
  private String[] numbers = { "first",  "second", "third", "fourth", "fifth",
  "abc", "def", "ghi", "jkl", "mno", "pqr", "stu", "vwx", "yz" };
  
  public HeavyPopTest04() {
    combo = new JComboBox(numbers);
    pFactory = PopupFactory.getSharedInstance();
    popup = pFactory.getPopup(null,combo,500,500);
    popup.show();
    combo.setPopupVisible(true);
  }
        
  public static void main(String args[]) {
    HeavyPopTest04 t = new HeavyPopTest04();
  }
}

Comments
EVALUATION The sample code ends up creating a Window to host the JComboBox. This Window is created with an offscreen Frame as the parent (Popup.DefaultFrame) that is never made visible. From the javadoc for Window.isFocusableWindow: * For a Window that is not a Frame or * Dialog to be focusable, its focusable Window state must be set to * <code>true</code>, its nearest owning Frame or Dialog must be * showing on the screen in this case the nearset owning Frame isn't showing, and thus we are likely getting this odd behavior. I'm reassigning to awt for further investigation. scott.violet@eng 2001-07-12 Name: rpR10076 Date: 08/02/2001 ###@###.### The behaviour described in the report is still reproducible with merlin beta build b73. I tried it on sparc solaris 2.8, with CDE window manager, but it may be reproducible in other conditions, too. ====================================================================== Name: rpR10076 Date: 11/15/2001 commit to hopper and tiger ====================================================================== Name: dmR10075 Date: 05/17/2002 Not reproducible with Hopper b11 - was fixed along with 4546712 ###@###.### 2002-05-17 ======================================================================
17-05-2002