RFR: 8280861: Robot color picker broken on Linux with scaling above 100%

Sergey Bylokhov serb at openjdk.java.net
Fri Feb 11 07:13:09 UTC 2022


On Fri, 11 Feb 2022 06:14:27 GMT, Maxim Kartashev <duke at openjdk.java.net> wrote:

>> I have no idea what MATE is but if you are saying you have a recent Ubuntu and you don't have GTK2, I am at least 95% sure GTK2 is still available from Ubuntu package manager for all current releases.
>
> MATE desktop continues the "traditional" Gnome2 desktop development, so I thought it would be a good test for Gtk2 interfaces. FWIW, I ran the tests on such a system with DPI set to 200 (there's no other way to scale the interface under MATE AFAIK) and they all pass. However, the test executes the same code path as before going by `if (gtk3_version_3_10)` branch.
> 
> @prrace 
>> GTK2 is still available from Ubuntu package manager for all current releases.
> 
> Right, but as long as gtk3 is *also* available, that's what we are going to use as AWT backend, see the code in [gtk_interface.c](https://github.com/openjdk/jdk/blob/eee6a5622dca683d4d6a701daa48e09e8d17b54e/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c#L109).
> I hacked around to forbid gtk3 from loading and the tests still passed (this time, without executing my changes).
> I think gtk2 has no real notion of scale so the coordinates and size are always in screen pixels. See, for example, the documentation for [gdk_pixbuf_get_from_drawable()](https://www.manpagez.com/html/gdk2/gdk2-2.24.29/gdk2-Pixbufs.php#gdk-pixbuf-get-from-drawable).

You do not need to hack the code, just add a "jdk.gtk.version" option to enable specific gtk version, this is what I suggested above. to disable the gtk usage in the robot the "awt.robot.gtk" can be used. So you can add that to some test to check that code paths works.

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

PR: https://git.openjdk.java.net/jdk/pull/7425



More information about the client-libs-dev mailing list