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

On windows 10 with dual screen setup, maximize window breaks on non-main display

XMLWordPrintable

    • x86_64
    • windows

      ADDITIONAL SYSTEM INFORMATION :
      Microsoft Windows [Version 10.0.19043.1165]
      java.runtime.version=1.8.0_60-b27
      java.runtime.version=1.8.0_152-b16
      (this bug is in multiple versions with multiple independent programs that I use and has been present for multiple years of the JDK)

      A DESCRIPTION OF THE PROBLEM :
      On windows, when using a dual screen setup whereby:
      -the taskbar is on left of screen (instead of default bottom), and
      -where the taskbar is only present on one screen and not both,
      the use of maximize for a java program window will work properly on the screen with the taskbar, but will break on other screen and size the program as though the taskbar is present (when it is not.)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Get a windows machine with two monitors (1=left, 2=right for sake of this discussion). Go to windows settings->display. Scroll to bottom for "multiple monitors" and EXTEND the screens (so windows uses both monitors as a single display, instead of "duplicate", or 'show 1', or 'show 2'). EXTEND is normally how people using dual displays.

      Also make the left/1 monitor the "main display" with checkbox. This generally means it will be the monitor to hold start button, taskbar, clock, etc.

      Exit settings.

      If you have default windows setup then the taskbar is on the bottom of the left/1 monitor ("main display") (althought it might ALSO be on both). RIGHT click the taskbar and choose TASKBAR SETTINGS. UNLOCK the taskbar (so you can move it), do NOT 'automatically hide', change taskbar LOCATION to LEFT of screen. "show taskbar on all displays" should be UNCHECK/OFF. Close settings.

      You should now have the windows taskbar on the LEFT edge of LEFT/1 monitor. There should be no taskbar on RIGHT/2 monitor. You can adjust the WIDTH of the taskbar by dragging so go ahead and make it 1-2" wide (presuming a 20" or so monitor) if it is too narrow. It won't affect this bug report but if your taskbar is narrow the bug isn't as visible.

      Now...Run any java program which creates a program window. I don't believe it matters and I have different applications on my machine (from different companies) that all use Java SE. Run anything you happen to have as long as it simply makes a standard UI window. (In other words, do NOT run a command prompt/dos/terminal program. This needs to be a Swing/JavaUI or whatever the java GUI is called.)

      Next...move the application window to LEFT/1 screen. Click Maximize button (or double click title bar) in order to max the program. RESULT: GOOD: it will max properly and fill the screen MINUS the taskbar on the left. This is normal.

      Next...click restore button to return the program window from the 'maximize' state and then drag/move the program to RIGHT/2 screen (which has no taskbar on the edge; taskbar is only on screen 1/LEFT). Click the "maximize" button on the program (or double click the title bar) to maximize and fill screen RIGHT/2.

      BUG: the program will maximize improperly on display RIGHT/2. It will maximize by leaving a blank space on the left edge corresponding to the vertical taskbar on monitor 1/LEFT, but which is actually *missing* from monitor 2/right. Java "sees" a taskbar which is not there and improperly maximizes the program window for an invisible/missing taskbar.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The maximize command on the right/2 monitor should fully fill the screen instead of leaving a 'ghost' space open as though a taskbar was present.

      CUSTOMER SUBMITTED WORKAROUND :
      No workaround. In order to get java programs to properly max on screen right/2 a user has to take the program off 'max' (into 'restore' or sizable window mode) and then manually stretch the program corners to fit the window. Maximize functionality is broken.

            pardesha Pardeep Sharma
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: