On Tue, 17 Nov 2026 19:26:14 GMT, Andy Goryachev <[email protected]> wrote:
>> 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. Maybe, but the problem with this is that the test can then pass without actually activating, thus not testing anything. I'd probably lean towards waiting for focus, failing if we don't get it, and skipping it on Linux for this specific test if there is a concern. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2373#discussion_r4605022252
