scijava / scijava-common

A plugin framework and application container with built-in extensibility mechanism :electric_plug:
BSD 2-Clause "Simplified" License
91 stars 52 forks source link

UIService.showUI() shows multiple instances of the same UI #460

Closed gselzer closed 1 year ago

gselzer commented 1 year ago

I found this with the ImageJ2 UI in napari-imagej:

image

Ideally, UIService.show() would check if there is already a UI visible, and then, if it is, ensure that the application frame is also visible. This is what I was doing in napari-imagej, however it is a little hacky (why would the ImageJ2 UI be visible and the application frame not be?)

Note that in napari-imagej, I also kill all WindowListeners, and add my own that hides the window when the user presses the close button, instead of actually closing the window.