RFR: 6681958: Maximization state of JInternalFrames is corrupted by WindowsDesktopManager
Phil Race
prr at openjdk.org
Tue Oct 10 20:10:49 UTC 2023
On Mon, 9 Oct 2023 05:17:58 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> 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.
src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsDesktopManager.java line 80:
> 78: if (f.isMaximizable()) {
> 79: if (!f.isMaximum()) {
> 80: f.setMaximum(true);
So if the new frame is set to maximum=true, don't you need to set the current frame to maximum=false ?
The way I'm interpreting the class doc. and the comment about "transfer" is that only one frame can be in the maximised state.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16097#discussion_r1353226587
More information about the client-libs-dev
mailing list