Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8087498

[Mac] Full screen mode fails for certain StageStyles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u40, 9
    • javafx
    • None
    • Mac OS X 10.10
      JDK 8u40

      The following test case proves that for stages that are initialized with other stage styles than DECORATED, the stage.setFullScreen() method does not work. If you run the sample and try, say, StageStyle.TRANSPARENT, JavaFX hangs instead of making the stage full screen.

      This is problematic, because modern Mac applications like Safari, Chrome, Spotify, etc., that place contents in the window title bar and use rounded corners are forced to use StageStyle.TRANSPARENT to do so. However, in Mac OSX Yosemite the green maximize button should now work as a full screen button according to Apples design guidelines. We cannot implement our own green full screen button and live up to the Mac guidelines, unless this bug is fixed.

      public class FullScreenBug extends Application {

      @Override
      public void start(Stage stage) throws Exception {
      BorderPane borderPane = new BorderPane();
      ToggleButton button = new ToggleButton("Full Screen");
      button.setOnAction(event -> {
      stage.setFullScreen(button.isSelected());
      });
      borderPane.setCenter(button);
      stage.setWidth(800);
      stage.setHeight(600);
      stage.setScene(new Scene(borderPane));
      stage.initStyle(StageStyle.TRANSPARENT);
      stage.show();
      }

      public static void main(String[] args) {
      Application.launch(args);
      }
      }

            azvegint Alexander Zvegintsev
            risaksen Randahl Isaksen
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: