浏览代码

set owner of wrong file alert window

Armin Schrenk 5 年之前
父节点
当前提交
c8e33acaf7
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      main/ui/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertModule.java

+ 3 - 1
main/ui/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertModule.java

@@ -14,6 +14,7 @@ import org.cryptomator.ui.common.FxController;
 import org.cryptomator.ui.common.FxControllerKey;
 import org.cryptomator.ui.common.FxmlFile;
 import org.cryptomator.ui.common.FxmlScene;
+import org.cryptomator.ui.mainwindow.MainWindow;
 
 import javax.inject.Named;
 import javax.inject.Provider;
@@ -34,10 +35,11 @@ abstract class WrongFileAlertModule {
 	@Provides
 	@WrongFileAlertWindow
 	@WrongFileAlertScoped
-	static Stage provideStage(ResourceBundle resourceBundle, @Named("windowIcons") List<Image> windowIcons) {
+	static Stage provideStage(@MainWindow Stage mainWindow, ResourceBundle resourceBundle, @Named("windowIcons") List<Image> windowIcons) {
 		Stage stage = new Stage();
 		stage.setTitle(resourceBundle.getString("wrongFileAlert.title"));
 		stage.setResizable(false);
+		stage.initOwner(mainWindow);
 		stage.initModality(Modality.WINDOW_MODAL);
 		stage.getIcons().addAll(windowIcons);
 		return stage;