About Focus Stealing Prevention on GNOME/Linux

Thiago Milczarek Sayão thiago.sayao at gmail.com
Wed Sep 25 17:29:46 UTC 2024


Hi,

This is just for information, in case someone complains about it.

Focus Stealing Prevention currently does affect JavaFX on Linux (on gnome).
For example, sometimes an APPLICATION_MODAL error dialog will not get
focus, instead, a notification is shown that "Error dialog is ready".

This is confusing for users, since the APPLICATION_MODAL will block other
windows and at the same time will stay behind, since the focus was
"prevented".

It's actually hard to simulate, but it does happen.

This post explains it with some detail:
https://blogs.gnome.org/shell-dev/2024/09/20/understanding-gnome-shells-focus-stealing-prevention/

It might be the case that when the native modality functionality is used,
it's taken into account for preventing focus.

JavaFX does have native modality implemented, but does not use it (must be
a reason).

It's on com.sun.glass.ui.Window.enterModal();

-- Thiago.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20240925/ce738299/attachment.htm>


More information about the openjfx-dev mailing list