Skip to content

Commit c96312a

Browse files
Fix focus issue
1 parent e1f2088 commit c96312a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pacman-ui/src/main/java/de/amr/pacmanfx/ui/PacManGames_UI_Impl.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,13 @@ public void showStartView() {
310310
theGameClock.setTargetFrameRate(Globals.NUM_TICKS_PER_SEC);
311311
theSound().stopAll();
312312
playView.dashboard().setVisible(false);
313-
startPagesView.currentStartPage().ifPresent(startPage -> {
314-
startPage.layoutRoot().requestFocus();
315-
startPage.onEnter(this); // sets game variant!
316-
});
317313
selectView(startPagesView);
314+
startPagesView.currentStartPage().ifPresent(startPage -> {
315+
Platform.runLater(() -> {
316+
startPage.onEnter(this); // sets game variant!
317+
startPage.layoutRoot().requestFocus();
318+
});
319+
});
318320
}
319321

320322
@Override

0 commit comments

Comments
 (0)