<div dir="ltr"><div><div><div><div><div><div><div>Hi All!</div><div><br>Please review the fix for JDK 13:<br><br></div><div>Bug: <a href="https://bugs.openjdk.java.net/browse/JDK-8225118">https://bugs.openjdk.java.net/browse/JDK-8225118</a><br></div><div>Fix: <a href="http://cr.openjdk.java.net/~ant/JDK-8225118/webrev.0">http://cr.openjdk.java.net/~ant/JDK-8225118/webrev.0</a><br><br></div><div>The problem with Robot.createScreenCapture() on gtk3 is in the following function call (quoting from gtk3_interface.h):<br>fp_gdk_pixbuf_get_from_drawable = dl_symbol("gdk_pixbuf_get_from_window")<br></div><div>which, as you can see, is resolved to another function in gtk3 (unlike gtk2) due to its deprecation.<br><br>The spec [1] states that the passed size is scaled:</div>"the width and height arguments scaled by the scale factor of window"<br></div>however this fact is not taken into account and so the returned pixbuf has wrong size and is then ignored.<br><br></div>To meet the spec, I retrieve the root window scale and downscale the size, ceiling the result. Also, I weaken the condition where the pixbuf size is compared to the passed size, from "==" to ">=". My reasoning is this:<br></div>1) The original passed size (of the screen) may appear to be lossy due to downscaling/upscaling ops.<br></div>2) The weakened condition is enough for the valid pixbuf copying.<br><br></div><div>The test (which I've modified to allow its run on Linux) reproduces the issue.<br></div><div><br></div>With regards,<br></div>Anton.<br><div><div><div><div><div><div><div><em class="gmail-parameter"><code></code></em></div><div><em class="gmail-parameter"><code><br></code></em>[1] <a href="https://developer.gnome.org/gdk3/stable/gdk3-Pixbufs.html#gdk-pixbuf-get-from-window">https://developer.gnome.org/gdk3/stable/gdk3-Pixbufs.html#gdk-pixbuf-get-from-window</a></div><div><br></div></div></div></div></div></div></div></div>