On Mon, 18 Dec 2023 16:15:09 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
> > > > This is happening in linux > > > > Is it the Linux only? If yes why it cannot be reproduced on macOS and > > > > Windows? > > > > > > Yes, This is happening only in linux. The paintToOffScreen is done by > > BufferStrategyPaintManager rather than RepaintManager (which is the case in > > macOS and Windows). > > Renjith @Renjithkannath worked on a similar bug, > [JDK-8256639](https://bugs.openjdk.org/browse/JDK-8256639): _Test > `javax/swing/JPopupMenu/7160604/bug7160604.java` fails on Ubuntu_, and he > reproduced the problem on macOS too, yet you have to make popups lightweight, > they're heavyweight on macOS by default. > > He tracked it down to the same root cause. His suggested fix was very similar > to the one that @TejeshR13 proposes here. I wasn't convinced at that time > that it was the best fix but I hadn't had time to look into it further. > > Neither have I looked at this code review thoroughly yet. > > Unfortunately, JDK-8256639 cannot be opened because it contains confidential > information in its description. Yeah, looks like both the issue has the same root cause... As per my analysis in bufferStrategyManager the Graphics used is `bsg` rather than what is passed down from Component. I confirmed the root cause by passing down the component Graphics to Offscreen painting where the issue didn't reproduce. Hence clearing the `bsg` Graphics solves the issue. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17081#issuecomment-1862124907