RFR: 6681958: Maximization state of JInternalFrames is corrupted by WindowsDesktopManager

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon Oct 9 05:25:27 UTC 2023


Issue is if one internal frame is open and maximized and another internal frame is created which is initialized with setMaximum(true) then after opening the second internal frame both internal frames are non-maximized
It can also be seen with SwingSet2 JInternalFrameDemo in WIndowsLookAndFeel i.e. when Frame 0 is maximised, and then Frame1 is maximised and then minimised, Frame0 should remain maximised but it is now unmaximised

Issues seen with JInternalFrame in WindowsLookAndFeel are
- Frame 0 maximised
 - Frame 4 maximised, when minimised, Frame0 is seen to be restored to normal size with Frame4 minimised
 - Frame 0 is again maximised
 - Frame 4 maximised from minimised, instead of maximising, it restores both Frame0 and Frame4

The fix makes sure the maximised internal frame remains maximised when the 2nd internal frame is maximised
This code seems to be added for [JDK-5036083](https://bugs.openjdk.org/browse/JDK-5036083) which expects 
`When a frame is maximized and then minimized, the next frame should NOT be maximized.`

It still honours that fix as the  test mentioned in JDK-5036083 works as expected as mentioned above

Also it is mentioned 
https://github.com/openjdk/jdk/blob/dc4bc4f0844b768e83406f44f2a9ee50686b1d9d/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsDesktopManager.java#L69-L70

It can be seen it is still honored. In SwingSet2 JInternalFrameDemo in WindowsL&F, if Frame0 is maximised and then Frame1 is activated/selected, it becomes maximised
Also, it doesn't cause any regression with our existing closed/open tests.

-------------

Commit messages:
 - 6681958: Maximization state of JInternalFrames is corrupted by WindowsDesktopManager
 - 6681958: Maximization state of JInternalFrames is corrupted by WindowsDesktopManager

Changes: https://git.openjdk.org/jdk/pull/16097/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16097&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-6681958
  Stats: 3 lines in 1 file changed: 0 ins; 3 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/16097.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16097/head:pull/16097

PR: https://git.openjdk.org/jdk/pull/16097


More information about the client-libs-dev mailing list