RFR: 8305578: X11GraphicsDevice.pGetBounds() is slow in remote X11 sessions [v2]
Maxim Kartashev
mkartashev at openjdk.org
Thu Apr 13 15:31:59 UTC 2023
On Tue, 11 Apr 2023 00:09:39 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> Maxim Kartashev has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Added X11GraphicsDevice.bounds
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13346#discussion_r1165704393
More information about the client-libs-dev
mailing list