On Wed, 11 Oct 2023 02:40:20 GMT, Prasanta Sadhukhan <[email protected]>
wrote:
>> 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.
>
> I was interpreting it as transfer the attribute but retain it for current
> frame....but it seems your interpretation is more logical...so I have updated
> the PR..
> Since I guess there's no JInternalFrame equivalent in native widget, it
> leaves scope for interpretation..
>
> Now with this fix, in SwingSet2 JInternalFrame demo in WindowsL&F
>
> - If Frame 0 maximised, it goes to maximised state
> - Then when another frame say, Frame 4 maximised, Frame 4 is not restored to
> un-maximised size but actually been maximised and Frame0 is restored to
> un-maximised state..
I'm still not sure everything is right.
It seems that a frame can have the "maximized" state, even if it is currently
iconified.
Why ? Well because have this test "if (!currentFrame.isIcon()) {" // (line 77)
which we can only reach "currentFrame.isMaximum()" // line 71
I'm wondering if that test at line 77 should be there ?
It prevents anything happening if the currently maximised frame is iconified.
Doesn't it ?
Seems like it shouldn't matter, the new frame "f" should be set to maximum
regardless
I don't understand that 'special case' comment either.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16097#discussion_r1364538277