On Tue, 10 May 2022 12:56:53 GMT, Thiago Milczarek Sayao <tsa...@openjdk.org> 
wrote:

>> When there's an APPLICATION_MODAL window, all other windows are disabled and 
>> re-enabled when the APPLICATION_MODAL window closes. This causes 
>> `requestToFront()` to be called on every window, and it does not guarantee 
>> order.
>> 
>> The fix also works for:
>> https://bugs.openjdk.java.net/browse/JDK-8269429
>> 
>> But this one might need another fix:
>> https://bugs.openjdk.java.net/browse/JDK-8240640
>
> Thiago Milczarek Sayao has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Revert "Set the focus on the latest window when re-enabling them"
>   
>   This reverts commit b024de586c187f9000f791dab99507a4979cc027.

I reverted the last change.

After more analysis I think it's not a bug, but a side-effect of not using 
native window modality in favor of enabling/disabling windows.

It works like this:

On the original step 5 ("Click anywhere in Window One") the window would get 
the focus, but instead will send a FOCUS_DISABLED event, which will bring up 
the MODAL window. 

The problem is that the window will get the focus, to be lost in favor of the 
last window (which is the MODAL one).

To prevent this, a disabled window should never be focused. But that prevents 
the whole FOCUS_DISABLED logic.

Note that the APPLICATION_MODAL window on the example has no owner, so I think 
it's ok to consider a side effect and not a bug.

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

PR: https://git.openjdk.java.net/jfx/pull/784

Reply via email to