RFR: 8280861: Robot color picker broken on Linux with scaling above 100%
Maxim Kartashev
duke at openjdk.java.net
Fri Feb 11 06:18:09 UTC 2022
On Thu, 10 Feb 2022 22:28:56 GMT, Phil Race <prr at openjdk.org> wrote:
>> Maybe not as the previous fix was mode for gtk3 only, but I can double-check. Do you know if MATE desktop environment is a good candidate for finding gtk2 or are there easier options on Ubuntu?
>
> 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).
-------------
PR: https://git.openjdk.java.net/jdk/pull/7425
More information about the client-libs-dev
mailing list