From dbb5dc350b374a369c12b1f41c761f8aaadb3b29 Mon Sep 17 00:00:00 2001 From: Gregor Lohaus Date: Mon, 1 Jun 2026 03:30:45 +0200 Subject: [PATCH] grap focus on launch --- src/main/java/com/gregor/jprototerm/Main.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/gregor/jprototerm/Main.java b/src/main/java/com/gregor/jprototerm/Main.java index ed6d313..e7464e3 100644 --- a/src/main/java/com/gregor/jprototerm/Main.java +++ b/src/main/java/com/gregor/jprototerm/Main.java @@ -59,6 +59,10 @@ public final class Main extends Application { // to honour, so place it on the screen under the mouse pointer instead. centreOnActiveScreen(stage, config.windowWidth(), config.windowHeight()); stage.show(); + // Ask the window manager to raise and focus the new window so the user can type right + // away; the canvas requestFocus() below only routes events within the scene. + stage.toFront(); + stage.requestFocus(); compositor.canvas().requestFocus(); }