JDK-6580925 : Swing Popups don't get hidden on Alt+Tab
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2007-07-16
  • Updated: 2011-01-19
  • Resolved: 2008-04-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Relates :  
Description
On Windows OS all popups are get hidden when you press Alt+Tab,
I think it should happen on GTK as well

This bug is very visible with the JTrayIcon draft implementation

Expected:
You press Alt+Tab and popups are closed

Actual:
Popups stay open

To check it use the following test:

import javax.swing.*;

public class PopupTest {

    private static void createGui() {
        final JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JPopupMenu menu = new JPopupMenu("Menu");
        menu.add(new JMenuItem("MenuItem"));
        menu.add(new JMenuItem("MenuItem"));
        menu.add(new JMenuItem("MenuItem"));
        menu.add(new JMenuItem("MenuItem"));
        menu.add(new JMenuItem("MenuItem"));

        JPanel panel = new JPanel();
        panel.setComponentPopupMenu(menu);
        frame.add(panel);

        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

    public static void main(String[] args) throws Exception {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                PopupTest.createGui();
            }
        });
    }
}

Comments
EVALUATION the described behavior is standard one under Linux (at least for gtk-based apps) Thus I'm closing the CR as not a bug,
21-04-2008

EVALUATION need to investigate why native grab doesn't send ungrab event in this case.
19-07-2007