On Fri, 2 Feb 2024 07:01:20 GMT, Tejesh R <[email protected]> wrote: >> src/java.desktop/share/classes/javax/swing/BufferStrategyPaintManager.java >> line 251: >> >>> 249: g2d.setBackground(paintingComponent.getBackground()); >>> 250: g2d.clearRect(x, y, w, h); >>> 251: g2d.setBackground(oldBg); >> >> Shouldn't we limit this change to non-opaque components only? >> `if (!bufferComponent.isOpaque())` >> >> Also, it might be worthwhile to find a way not to clear the whole >> screen/window area (if possible), but only the dirty part. > > Yeah, will updated to non-opaque types. Will explore on clearing the dirty > regions rather than whole screen.
I have updated to non-opaque regions and its working fine. Couldn't find a way to clear only the dirty regions. >> test/jdk/javax/swing/JFrame/JFrameBackgroundRefreshTest.java line 45: >> >>> 43: * @build PassFailJFrame >>> 44: * @summary Test to check if JFrame background is refreshed in Linux. >>> 45: * @requires (os.family == "linux") >> >> Why should this test only run on Linux? > > Since the fix was done for linux alone, I have restricted the test to it. > Anyhow it works on windows and mac. Somehow the automated test is not working flawless in windows and mac. In windows the image is getting stuck at center of white frame when its made automatic and in mac CI machines are failing even though the white screen is clear. Since the fix is specifically for linux I think we can leave the test for linux alone. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17081#discussion_r1479366129 PR Review Comment: https://git.openjdk.org/jdk/pull/17081#discussion_r1479364743
