<Swing Dev> RFD: JEP: Modernize the GTK3 Look and Feel implementation for OpenJDK

Mario Torre neugens at redhat.com
Tue Nov 25 14:39:49 UTC 2014


On Tue, 2014-11-25 at 17:04 +0300, Sergey Bylokhov wrote:
> Hi Mario, you are welcome!
> The first question, which I am thinking about, is why it will be a new 
> look and feel, probably will be better to check version of the gtk on 
> the fly and use it. So if gtk3 is available it will be used, otherwise 
> gtk2. At least this possibilities should be highlighted in the proposed JEP.

Hi Sergey,

Thanks for the reply!

There are two reason why I propose a new Look and Feel. The first is
compatibility, since some applications may expect the old GTK2 based
variant, and break with the newer one.

While this is an issue, it can be easily solved for example by offering
a "compatibility" path (like passing a property on the command line or
so). Also, this is really an issue even today, because GTK supports
themes and applications may still render incorrectly under certain
themes.

There is, however, a second reason.

The current GTKLookAndFeel code relies heavily on features (or well, the
lack of) of a specific older version of GTK, in other words it uses
GdkDrawable.

This is not only not compatible to GTK3, but it's also a major point of
issues due to the lack of support for transparent images.

There's actually a nice comment in gtk2_interface.c that explain the
issue quite well.

While changing the code to use cairo could be an option, I don't know if
this is really what we want, since it would be quite significant and we
should still have different code paths to accomodate both GTK2 and GTK3
(although probably at this point most of the differences would be hidden
in the native code).

Given the efforts to port the old code to the newer, including testing
efforts, I think having a separate implementation is significantly
easier.

What do you think?

I can add these motivations to the JEP if you think it's needed.

Cheers,
Mario





More information about the swing-dev mailing list