Changeset 18934 in josm


Ignore:
Timestamp:
2024-01-03T16:22:55+01:00 (5 months ago)
Author:
taylor.smock
Message:

Fix #23362: Cannot close ImageViewerDialog when multiple image layers are available

File:
1 edited

Legend:

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

    r18924 r18934  
    180180        this.layers.getModel().addChangeListener(l -> {
    181181            // We need to check to see whether or not the worker is shut down. See #22922 for details.
    182             if (!MainApplication.worker.isShutdown()) {
     182            if (!MainApplication.worker.isShutdown() && this.isDialogShowing()) {
    183183                MainApplication.worker.execute(() -> GuiHelper.runInEDT(() -> {
    184184                    Component selected = this.layers.getSelectedComponent();
     
    189189            }
    190190        });
     191    }
     192
     193    @Override
     194    public void showNotify() {
     195        super.showNotify();
     196        Component selected = this.layers.getSelectedComponent();
     197        if (selected instanceof MoveImgDisplayPanel) {
     198            ((MoveImgDisplayPanel<?>) selected).fireModelUpdate();
     199        }
    191200    }
    192201
     
    930939        if (!isDialogShowing()) {
    931940            setIsDocked(false); // always open a detached window when an image is clicked and dialog is closed
    932             showDialog();
     941            unfurlDialog();
    933942        } else if (isDocked && isCollapsed) {
    934943            expand();
Note: See TracChangeset for help on using the changeset viewer.