JDK-8237491 : [Linux] Undecorated stage cannot be maximized
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 8,openjfx11,openjfx14
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2020-01-17
  • Updated: 2020-11-05
  • Resolved: 2020-11-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
openjfx16Fixed
Related Reports
Cloners :  
Relates :  
Relates :  
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



Comments
Changeset: 08d8a980 Author: Thiago Milczarek Sayao <tsayao@openjdk.org> Committer: Kevin Rushforth <kcr@openjdk.org> Date: 2020-11-05 16:01:07 +0000 URL: https://github.com/openjdk/jfx/commit/08d8a980
05-11-2020

PR https://github.com/openjdk/jfx/pull/345 proposes to fix this on Linux, so I have split this bug into 2 issue. This issue will track the failure on Linux and the new bug, JDK-8255835, will track it on macOS.
03-11-2020

I have fixed it on https://github.com/openjdk/jfx/pull/77 (PR not specific). It was a simple fix (enable the functionality). Just commenting here if anyone is looking for a solution. Links to https://bugs.openjdk.java.net/browse/JDK-8236651
03-04-2020

Reproducible on openjfx11+ as well.
18-01-2020