0

Context: In a multi-monitor setup, I start a JavaFx application in Full Screen mode in 1 of the screens. Different applications are open in other screens.

Issue: Once the JavaFx application starts, the moment I click on another application in another screen, the JavaFx app full screen minimizes to the application bar.

Research: I refer to inputs in Link1 Link2 Link3 but in those cases they are trying to change scenes within the same full-screen application. In this case I am clicking on an unrelated application in another screen yet the full screen app minimizes.

Is there a way to prevent this behavior?

Main:

 @Override
public void start(Stage primaryStage) throws Exception{
    Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
    primaryStage.setTitle("Hello World");
    primaryStage.setScene(new Scene(root, 300, 275));
    primaryStage.setFullScreen(true);
    primaryStage.show();
}

Controller:

public class Controller {}

FXML:

<GridPane fx:controller="sample.Controller"
      xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10"></GridPane>
iCoder
  • 1,406
  • 6
  • 16
  • 35
  • Did you play around? `Stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);` / overriding `toBack() {}`? – Joop Eggen Sep 24 '18 at 11:30
  • @JoopEggen yes I did try that as well as mentioned in those links, but doesnt work. Unable to figure out why clicking another unrelated application is changing behavior of this application – iCoder Sep 24 '18 at 11:45
  • Yeah, front-to-back or focus-lost might have done that. Of course there is the source code, for a break point. – Joop Eggen Sep 24 '18 at 11:47
  • I Just tested this on my multi monitor Mac ide intellij java 8 this doesn't happen to me what are your specs is your application in a .jar or ide idk if this makes a difference? – Matt Sep 24 '18 at 14:34
  • @Matt I am using windows 10, JDK10 Intellij ide, its still in dev stage so no jar of the application yet. – iCoder Sep 24 '18 at 16:20
  • An update, I notice that the fullscreen app does not minimize remains in fullscreen mode but just goes to background when I click on another application in any other screen. I guess it is more of Windows OS thing & not something that can be controlled from within FX. Hope an expert confirms this or points at what I need to do to achieve it. – iCoder Sep 24 '18 at 18:38

0 Answers0