On Mon, 9 Sep 2024 19:32:04 GMT, Alexey Ivanov <[email protected]> wrote:

>At the same time, I find it weird that repaint paints directly in its code and 
>then posts paint event.

This is one of the implementation details of the AWT, the "native" component 
should be painted before the paint event will proceed on EDT, and even if EDT 
is blocked the "native" part should be painted. Since the XAWT is implemented 
via Swing which is not thread-safe we should use some additional 
synchronization. On macOS we have a special lock for that 
https://github.com/openjdk/jdk/blob/559fc711e03cf0086bea399ffb40cf294cbbb6e1/src/java.desktop/macosx/classes/sun/lwawt/LWListPeer.java#L87
 and 
https://github.com/openjdk/jdk/blob/559fc711e03cf0086bea399ffb40cf294cbbb6e1/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java#L361
 but on XAWT it is quite "cumbersome" since it was implemented a long time ago.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20861#discussion_r1750898850

Reply via email to