On Tue, 17 Nov 2026 12:07:02 GMT, Jose Pereda <[email protected]> wrote:
>> this is a code review comment, I have not run the test(s) yet. my pet LLM >> basically tells us that the test may not catch the NPE because it ends >> prematurely. > > You are right, the events that `requestFocus()` triggers run after the > runAndWait and the latch is already 0. On macOS, the events are synchronous > though, and that was passing locally for me. > I've changed it now to use latches based on focused stages, to prevent that > issue. > > I've tested this on macOS/Windows/Linux. The issue only happens on macOS (NPE > without the patch, passes with the pass). On Windows/Linux the test passes > always with or without the patch. > > There is an issue worth mentioning though: on some Linux setups, the window > manager might prevent the stages from getting the focus (unless clicked by a > user), and the test would fail. Maybe we should add a condition so it runs on > macOS (and maybe Windows) only? what do you think of adding a parallel timer for the platforms where we may not receive the focus? or maybe even on all the platforms? if we get the focus, the test ends, if not the timer fires and the test ends after a few seconds, but in any case it'll catch the NPE. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2373#discussion_r4604634331
