Delay window centering

This commit is contained in:
crschnick 2024-05-13 17:23:22 +00:00
parent fd282267de
commit 69dd83e2e4

View file

@ -8,6 +8,7 @@ import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.prefs.CloseBehaviourAlert;
import io.xpipe.app.util.ThreadHelper;
import io.xpipe.core.process.OsType;
import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.geometry.Rectangle2D;
@ -146,7 +147,9 @@ public class AppMainWindow {
stage.setOnShown(event -> {
PlatformThread.runLaterIfNeeded(() -> {
if (state == null && !shown.get()) {
Platform.runLater(() -> {
stage.centerOnScreen();
});
}
stage.requestFocus();
shown.set(true);