RFR: 8305578: X11GraphicsDevice.pGetBounds() is slow in remote X11 sessions [v3]

Sergey Bylokhov serb at openjdk.org
Fri Apr 14 19:46:32 UTC 2023


On Thu, 13 Apr 2023 15:28:52 GMT, Maxim Kartashev <mkartashev at openjdk.org> wrote:

>> src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java line 881:
>> 
>>> 879:     }
>>> 880: 
>>> 881:     private final Hashtable<GraphicsConfiguration, Insets> cachedInsets = new Hashtable<>();
>> 
>> You do not need to create a handcrafted list of gc->insets, but instead, you can save that information directly in the GC. In that case, each GC should be added as a listener(DisplayChangedListener) to the SGE. I think the same should be done for the GD+bounds, see how it is implemented on macOS(CGraphicsDevice#displayChanged)
>
> I did what you suggested to `X11GraphicsDevice.bounds`; please, take a look.
> 
> As for insets, it is more complicated because they may change without `displayChanged()` being called; this happens when, for example, the size of the dock bar changes. We are notified of the `_NET_WORKAREA` property change for the root window that is not accompanied by the ConfigureNotify event. I'm reluctant to send `displayChanged()` in this case; it seems like an overkill for a change in the work area.

II suggest to check how it works on win/mac, does we trigger displayChanged in that case?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13346#discussion_r1167220493



More information about the client-libs-dev mailing list