[Mac] Full screen mode fails for certain StageStyles

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 8u40, 9
    • Component/s: javafx
    • None
    • Environment:

      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);
      }
      }

            Assignee:
            Alexander Zvegintsev
            Reporter:
            Randahl Isaksen
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: