mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Delay window centering
This commit is contained in:
parent
fd282267de
commit
69dd83e2e4
1 changed files with 4 additions and 1 deletions
|
@ -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()) {
|
||||
stage.centerOnScreen();
|
||||
Platform.runLater(() -> {
|
||||
stage.centerOnScreen();
|
||||
});
|
||||
}
|
||||
stage.requestFocus();
|
||||
shown.set(true);
|
||||
|
|
Loading…
Reference in a new issue