Skip to content

Commit

Permalink
Ensured owner stage is visible
Browse files Browse the repository at this point in the history
  • Loading branch information
JaniruTEC committed Jul 5, 2023
1 parent 88c5823 commit 0ce77cb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,19 @@ public CompletionStage<Stage> showPreferencesWindow(SelectedPreferencesTab selec
}

public CompletionStage<Stage> showVaultOptionsWindow(Vault vault, SelectedVaultOptionsTab tab, @Nullable Stage owner) {
return showMainWindow().thenApplyAsync((window) -> vaultOptionsWindow.create(vault, owner == null ? primaryStage : owner).showVaultOptionsWindow(tab), Platform::runLater).whenComplete(this::reportErrors);
return showMainWindow().thenApplyAsync(mainWindow -> {
assert mainWindow.isShowing();
if (owner == null) {
return mainWindow;
}
if (!owner.isShowing()) {
LOG.warn("While trying to show vault options for {}, owner stage was supplied, but is not visible.", vault.getDisplayName());
owner.show();
}
return owner;
}, Platform::runLater) //
.thenApplyAsync(finalOwner -> vaultOptionsWindow.create(vault, finalOwner).showVaultOptionsWindow(tab), Platform::runLater) //
.whenComplete(this::reportErrors);
}

public void showQuitWindow(QuitResponse response, boolean forced) {
Expand Down

0 comments on commit 0ce77cb

Please sign in to comment.