On Sun, 13 Apr 2025 18:01:08 GMT, Thiago Milczarek Sayao <tsa...@openjdk.org> 
wrote:

>> On some platforms (at least on Ubuntu 24.04 with GNOME and Windows 11), 
>> windows can remain maximized even when they are iconified (minimized). When 
>> the window is de-iconified (restored), it retains its maximized state.
>> 
>> The documentation in `Stage.java` regarding window states seems to align 
>> with this behavior. However, the code currently treats the 
>> `WindowEvent.RESTORE` event as both an unminimize (de-iconify) and an 
>> unmaximize.
>> 
>> Tests pass on Ubuntu 24.04 XWayland (with one unrelated screenCapture 
>> failure). But I would not rely on that since it needes specific tests.
>> 
>> This is not ready to integrate as it may break platform-specific 
>> code/behavior.
>
> Thiago Milczarek Sayao has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Missed one change

I have some issues with the premise of this pull request. It's true that a 
window's iconified and maximized _properties_ can be true at the same time. But 
the window itself can't be in both states at once; the user will never see a 
window that's both maximized and iconified. We need some way to track the 
actual state of the window and that's currently what the State in ui/Window 
does. Changing this to a bitfield would require extensive changes throughout 
the codebase.

The current behavior of RESTORE is correct. In terms of what the user sees 
there are three possible states: maximized, iconified, and neither. We have an 
event associated with entering each of these states (MAXIMIZE, MINIMIZE, and 
RESTORE). Glass should only send RESTORE when the window has entered a state 
that is neither maximized nor iconified so it's correct for the event handler 
to clear both of those properties.

This PR doesn't include any glass changes so it's hard to evaluate. Currently 
glass is tasked with notifying the core code when it enters a new state 
(maximized, iconified, or neither) without taking into account which state it 
was previously in. It looks like this PR is asking glass to distinguish between 
maximized => neither and iconified => neither but this seems redundant since 
the core code already knows the state and can figure this out.

At the very least this should be marked as draft since it doesn't include any 
glass changes.

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

PR Comment: https://git.openjdk.org/jfx/pull/1777#issuecomment-2802375322

Reply via email to