On Wed, 26 Apr 2023 10:29:00 GMT, Maxim Kartashev <mkartas...@openjdk.org> 
wrote:

>> Getting bounds of a `GraphicsDevice` and insets of a screen are fairly 
>> frequent operations. When working over the network (remote X session), those 
>> can take several *seconds* to complete, introducing repeated freezes even 
>> when typing in an editor feels only slightly sluggish.
>> 
>> On the other hand, neither bounds nor insets change very often - if at all - 
>> during the lifetime of an application. So caching their values seems like a 
>> natural solution to the problem. The caches need to be reset only when 
>> there's a possibility of change in the screens configuration.
>> 
>> A similar patch has been living in [JetBrains 
>> Runtime](https://github.com/JetBrains/JetBrainsRuntime/) for well over a 
>> year.
>
> Maxim Kartashev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Cache insets in X11GraphicsDevice instead of storing them all in XToolkit

src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java line 894:

> 892:             Insets insets = device.getInsets();
> 893:             if (insets == null) {
> 894:                 insets = getScreenInsetsImpl(gc);

Is it possible to set insets in the device constructor and update it on a 
callback? In this case, this method will be just an accessor.

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

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

Reply via email to