Skip to content

Commit d297417

Browse files
authored
fix: show/hide 前先 setIconified(false) 确保窗口状态正常 (#6525)
close #6523
1 parent 2854eac commit d297417

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎HMCL/src/main/java/org/jackhuang/hmcl/game/LauncherHelper.java‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.jackhuang.hmcl.util.platform.*;
5353
import org.jackhuang.hmcl.util.versioning.GameVersionNumber;
5454
import org.jackhuang.hmcl.util.versioning.VersionNumber;
55+
import org.jetbrains.annotations.Nullable;
5556

5657
import java.io.FileNotFoundException;
5758
import java.io.IOException;
@@ -760,7 +761,10 @@ private void checkExit() {
760761
case HIDE_AND_REOPEN:
761762
runLater(() -> {
762763
Optional.ofNullable(Controllers.getStage())
763-
.ifPresent(Stage::show);
764+
.ifPresent(stage -> {
765+
stage.setIconified(false);
766+
stage.show();
767+
});
764768
});
765769
break;
766770
case KEEP:
@@ -895,8 +899,10 @@ private void finishLaunch() {
895899
runLater(() -> {
896900
// If application was stopped and execution services did not finish termination,
897901
// these codes will be executed.
898-
if (Controllers.getStage() != null) {
899-
Controllers.getStage().hide();
902+
@Nullable Stage stage = Controllers.getStage();
903+
if (stage != null) {
904+
stage.setIconified(false);
905+
stage.hide();
900906
launchingLatch.countDown();
901907
}
902908
});

0 commit comments

Comments
 (0)