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

Maximized undecorated stage behaves inconsistently on different platforms

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8, openjfx11, openjfx14
    • Fix Version/s: tbd
    • Component/s: javafx
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      A DESCRIPTION OF THE PROBLEM :
      If maximize property is set to true for an undecorated Stage, the following behaviour is observed on different platforms:

        * Windows: Undecorated stage is maximized
        * MacOS: Undecorated stage is not maximized
        * Linux(Ubuntu): Undecorated stage is not maximized

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the sample on different operating systems



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The stage should be maximized on all platform or should not maximize on any platform

      ACTUAL -
      The stage is maximized on Windows but doesn't maximize on Linux or Mac OS

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;
      import javafx.stage.StageStyle;

      public class MaximizedStage extends Application {
          public void start (Stage stage) {
              StackPane sp = new StackPane(new Label("Hello"));
              stage.setScene(new Scene (sp, 500, 500));
              stage.initStyle(StageStyle.UNDECORATED);
              stage.show();
              stage.setMaximized(true);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Current workaround is to find the dimensions of the screen on which to the stage is to be shown and update the width and height of the Stage.

      stage.initStyle(StageStyle.UNDECORATED);
      stage.setWidth(Screen.getPrimary().getBounds().getWidth());
      stage.setHeight(Screen.getPrimary().getBounds().getHeight());
      stage.show();

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              kcr Kevin Rushforth
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: