RFR: 8187759: Background not refreshed when painting over a transparent JFrame [v4]

Sergey Bylokhov serb at openjdk.org
Tue Feb 20 05:36:56 UTC 2024


On Tue, 20 Feb 2024 05:17:04 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Frame dispose moved into EDT
>
> src/java.desktop/share/classes/javax/swing/BufferStrategyPaintManager.java line 252:
> 
>> 250:                     g2d.setBackground(paintingComponent.getBackground());
>> 251:                     g2d.clearRect(x, y, w, h);
>> 252:                     g2d.setBackground(oldBg);
> 
> I wonder what color should we use to clear the background? Should it be background color of the component, background color of the window, or (0,0,0)? What the Swing components usually do in that case?

Since this is an intermediate buffer its content should not affect the rendering, so it should contain only the image rendered by the component itself.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17081#discussion_r1495264220


More information about the client-libs-dev mailing list