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

Maximize when undecorated covers the taskbar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u51
    • javafx

      FULL PRODUCT VERSION :
      Microsoft Windows [Version 6.3.9600]
      (c) 2013 Microsoft Corporation. All rights reserved.

      C:\Users\Owner>java -version
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b26)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

      C:\Users\Owner>

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.3.9600]
      (c) 2013 Microsoft Corporation. All rights reserved.

      C:\Users\Owner>ver

      Microsoft Windows [Version 6.3.9600]

      C:\Users\Owner>

      A DESCRIPTION OF THE PROBLEM :
      When setting a stage that has StageStyle.UNDECORATED or StageStyle.TRANSPARENT the stage will cover the entire screen and overlap the taskbar. This was also an unresolved bug in the Swing framework where the behavior was also the same. Additionally the work around for this is to use Screen and get the visual bounds to move the window after setting it maximized however this causes brief flickering. Another variation of this work around is to set the maximum stage size however this only works the first time, but does eliminate the flickering, and is ignored by subsequent setMaximized calls.
      http://stackoverflow.com/questions/19632093/setting-a-jframe-without-overlapping-with-taskbar

      REGRESSION. Last worked in version 8u60

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a stage and set the StageStyle to UNDECORATED or TRANSPARENT. Then maximize the stage using setMaximized and it will overlap the taskbar.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would expect it to fill the only the visual bounds of the screen and not overlap the taskbar. I would also expect that if this were native functionality of the window manager the stage should still respect the maximum width and height that I have set for it.
      ACTUAL -
      The stage overlaps the taskbar and the maximum stage width and height is also ignored.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Stage stage = new Stage();

      stage.setScene(new Label("Hello, world!"));

      stage.initStyle(StageStyle.UNDECORATED);

      stage.show();

      stage.setMaximized(true);


      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Screen screen = Screen.getPrimary();
      Rectangle2D bounds = screen.getVisualBounds();

      stage.setMaximized(maximized);

      if (stage.isMaximized()) {
      stage.setX(bounds.getMinX());
      stage.setY(bounds.getMinY());
      stage.setHeight(bounds.getHeight());
      stage.setWidth(bounds.getWidth());
      }

      SUPPORT :
      YES

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: