<AWT Dev> RFR: 8239819 XToolkit: Misread of screen information memory

Philip Race philip.race at oracle.com
Sun Mar 15 01:50:49 UTC 2020


So the net result is hard-coding

+                params.add(BORDER_PIXEL, Long.valueOf(0));

?

Why do we need to set it at all if its invisible ?
And does that mean its hidden / overwritten or something else.

Also the code says BORDER, but below you wrote BACKGROUND.
Please clarify.


-phil.



On 2/22/20, 1:05 AM, Sergey Bylokhov wrote:
> Hello.
> Please review the fix for jdk/client.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8239819
> Fix: http://cr.openjdk.java.net/~serb/8239819/webrev.00
>
> The XAWT for some native structures uses special java wrappers. These
> wrappers have to be created on top of the native pointer and provide
> access to the native fields directly w/o JNI methods.
>
> We have incorrect usage of such wrapper in the XToolkit class:
> Toolkit creates AwtScreenData wrapper on top of the 
> XToolkit.getDefaultScreenData()
> https://hg.openjdk.java.net/jdk/jdk/file/321b6fbe6815/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java#l344 
>
>
> But unfortunately, this native method returns the wrong pointer
> to getDefaultConfig():
> https://hg.openjdk.java.net/jdk/jdk/file/321b6fbe6815/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c#l134 
>
>
> getScreenData() should be used instead of getDefaultConfig(), but 
> since native
> data for default configuration is bigger than screen data we most of the
> time read some "random" information about visual info.
>
> This code was added 17 years ago to set the background color of the
> XIconWindow which is used as an icon in the dock/taskbar/minimized icon.
> Looks like nobody noticed since then that the color used as a border is
> incorrect, because this color is actually is invisible.
> I have confirmed this  using different color variants and even checked
> mwm(kind of cde on linux). So decided revert that fix back.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/awt-dev/attachments/20200314/0946a311/attachment.htm>


More information about the awt-dev mailing list