RFR: 8006421: GraphicsConfiguration of a frame is changed when the frame is moved to another screen
Sergey Bylokhov
serb at openjdk.org
Wed Jun 7 03:46:53 UTC 2023
On Fri, 2 Jun 2023 08:27:17 GMT, Tejesh R <tr at openjdk.org> wrote:
> > We should check why that code does not work, note the code in that patch also support both Window and Canvas.
>
> We can use `getAppropriateGraphicsConfiguration()` of `XCanvasPeer` class, which solves the problem. We can use it whenever new screen is set/new screen GC is set (Not sure of why it wasn't used before). The old code gets defaultGC whenever screen switch happens. We can use the existing implementation, which is actually better than selecting TransparencyCapable GC alone. Their exist a regression for this re-use solution i.e., test [WindowGCChangeTest.java](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/Multiscreen/WindowGCChangeTest/WindowGCChangeTest.java), which is basically windows specific test.
If think that method should work even before the fix. In the peer we set the GC to some value we found, then call Component.setGraphicsConfiguration() which for canvas and window should call getAppropriateGraphicsConfiguration. Why it does not work?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14246#issuecomment-1579831928
More information about the client-libs-dev
mailing list