kirill-grouchnikov / substance

A modern and high-performant Swing look-and-feel library
164 stars 109 forks source link

Maximize bug on secondary screen when screen resolutions differ #74

Closed IvanRF closed 6 years ago

IvanRF commented 6 years ago

Version of Substance

8.0-dev

Version of Java

8 update 144

Version of OS

Win 10

The issue you're experiencing (expected vs actual, screenshot, stack trace etc)

This one is an old one, but it's still present on latest version.

You need two monitors with different screen sizes. Set the screen size for the secondary monitor bigger than the primary monitor. For example:

Steps to reproduce:

Expected: Window having full size on Screen 2. Actual: Window is correctly positioned on (0,0) but the frame size is equal to Screen 1 size, so it does not cover the full screen.

IvanRF commented 6 years ago

I forgot to mention, it only happens with Substance. MetalLookAndFeel has the expected behaviour.

kirill-grouchnikov commented 6 years ago

As far as multi-window setups go, I would have to defer fixing such bugs to people who are experiencing them, as I don't have a setup like that available to me.

Specifically, if you are running under decorated mode, it is handled by SubstanceTitlePane.MaximizeAction.actionPerformed. In addition to what MetalTitlePane.MaximizeAction.actionPerformed does, it also calls SubstanceRootPaneUI.setMaximized.

That method queries the graphics configuration of that app window and calls setMaximizedBounds on the matching JFrame. Not sure how this works for decorated Metal windows without that path though.

nroduit commented 6 years ago

I also have users who have reported this problem. As described above it happens when the resolution is different between the two screens. In my test, JFrame is not under decorated mode.

I confirm that it works as expected with non-substance L&F. Is the maximized function used the GraphicsConfiguration from the right GraphicsDevice? Is currentRootPaneGC updated when a window is moved from one screen to another?

I also had difficulties to reproduce this issue with such a particular screen configuration. It is possible with virtualbox (Windows guest + insert Guest Additions - for display driver) to have a second virtual screen and adapt the size dynamically. In the screenshot below, I open the application on the left virtual screen and then move to the right virtual screen, and you can see the result when the window is maximized. 2screens

kirill-grouchnikov commented 6 years ago

Will be tracked in kirill-grouchnikov/radiance#3

See http://www.pushing-pixels.org/2018/05/23/hello-radiance.html for context.