On Tue, 26 May 2026 23:16:24 GMT, Sergey Bylokhov <[email protected]> wrote:

>> src/java.desktop/share/classes/sun/awt/SunToolkit.java line 169:
>> 
>>> 167: 
>>> 168:     public SunToolkit() {
>>> 169:       initEQ();
>> 
>> Why is lazy init in `getSystemEventQueueImplPP` not enough and we need to 
>> initialize it here?
>
> I think for each postEvent we should call getSystemEventQueueImplPP at some 
> point to have a queue to post events?

No postEvent() did not do this.
Hndreds of tests failed without this being added.
There appear to be many code paths where only the appcontext initialization 
caused the EQ to be initialized. Some of them looked almost accidental like a 
call to insertTargetMapping(..) from XSelection triggered the app context 
creation which started the EQ. Quite a few tests failed on Linux when that call 
to insertTargetMapping(..) was removed.
Overall this is why this ended up being the last change.

So this is the simplest necessary change.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31262#discussion_r3307500369

Reply via email to