Changeset 19147 in josm for trunk/src


Ignore:
Timestamp:
2024-07-17T17:43:48+02:00 (4 months ago)
Author:
GerdP
Message:

fix #23392: JOSM doesn't work well when not maximized

  • use SwingUtilities.invokeLater() for the AlignImageryPanel
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AlignImageryPanel.java

    r16553 r19147  
    1212import javax.swing.JCheckBox;
    1313import javax.swing.JPanel;
     14import javax.swing.SwingUtilities;
    1415import javax.swing.border.CompoundBorder;
    1516import javax.swing.border.EmptyBorder;
     
    2021import org.openstreetmap.josm.gui.MainApplication;
    2122import org.openstreetmap.josm.gui.MapFrame;
    22 import org.openstreetmap.josm.gui.util.GuiHelper;
    2323import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
    2424import org.openstreetmap.josm.gui.widgets.UrlLabel;
     
    9090        BooleanProperty showAgain = new BooleanProperty("message.imagery.nagPanel." + infoToAdd.getUrl(), true);
    9191        MapFrame map = MainApplication.getMap();
    92         if (MainApplication.isDisplayingMapView() && showAgain.get() && !infoToAdd.isGeoreferenceValid()
    93                 && map.getTopPanel(AlignImageryPanel.class) == null) {
    94             double w = GuiHelper.getScreenSize().getWidth();
    95             map.addTopPanel(new AlignImageryPanel(w > 1300, showAgain, infoToAdd));
     92        if (MainApplication.isDisplayingMapView() && Boolean.TRUE.equals(showAgain.get())
     93                && !infoToAdd.isGeoreferenceValid() && map.getTopPanel(AlignImageryPanel.class) == null) {
     94            SwingUtilities.invokeLater(() -> {
     95                double w = map.getWidth();
     96                map.addTopPanel(new AlignImageryPanel(w > 1300, showAgain, infoToAdd));
     97            });
    9698        }
    9799    }
Note: See TracChangeset for help on using the changeset viewer.