Ignore:
Timestamp:
2018-09-13T22:48:54+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #16730 - make sure we try to display popup menus only if their parent is visible on screen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/util/MultikeyActionsHandler.java

    r14153 r14248  
    2424
    2525import org.openstreetmap.josm.gui.MainApplication;
     26import org.openstreetmap.josm.gui.MainFrame;
    2627import org.openstreetmap.josm.gui.util.MultikeyShortcutAction.MultikeyInfo;
    2728import org.openstreetmap.josm.tools.Shortcut;
     
    101102            }
    102103            layers.addPopupMenuListener(new StatusLinePopupMenuListener());
    103             layers.show(MainApplication.getMainFrame(), Integer.MAX_VALUE, Integer.MAX_VALUE);
    104             layers.setLocation(MainApplication.getMainFrame().getX() + MainApplication.getMainFrame().getWidth() - layers.getWidth(),
    105                                MainApplication.getMainFrame().getY() + MainApplication.getMainFrame().getHeight() - layers.getHeight());
     104            MainFrame mainFrame = MainApplication.getMainFrame();
     105            if (mainFrame.isShowing()) {
     106                layers.show(mainFrame, Integer.MAX_VALUE, Integer.MAX_VALUE);
     107                layers.setLocation(mainFrame.getX() + mainFrame.getWidth() - layers.getWidth(),
     108                                   mainFrame.getY() + mainFrame.getHeight() - layers.getHeight());
     109            }
    106110        }
    107111    }
Note: See TracChangeset for help on using the changeset viewer.