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

[Mac] Full screen mode fails for certain StageStyles

    XMLWordPrintable

    Details

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

      Mac OS X 10.10
      JDK 8u40

      Description

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported: