Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] Linux: handle problematic GTK3 themes

An extreme example of controls that looks much different in Linux Mint 17.1 and SmartGit (using SWT 4.922) can be seen in the attached screenshot. Setting -Dorg.eclipse.swt.internal.gtk.noThemingFixes has no effect. It looks rather like some completely different theme is used.

--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog


On 2019-01-07 16:29, Thomas Singer wrote:
Hi Eric,
On 07/01/2019 16:21, Eric Williams wrote:
Hi Thomas,

On 1/7/19 4:30 AM, Thomas Singer wrote:
Hello,

It looks like some GTK themes cause more problems on Linux than others, e.g. we have a couple of problems with Mint-X on Linux Mate 17.1.

According to <https://developer.gnome.org/gtk3/3.20/gtk-running.html> it should be possible to change the theme of a certain application by setting the environment variable GTK_THEME before launching the application (ours usually is launched from a .sh script so adding the "export GTK_THEME=..." line would be no problem). Unfortunately, this does not work - it simply uses the default Mint-X theme.

We have support in SWT to read the GTK_THEME environment variable, so this should work. How are you using it? IIRC the theme has to be installed on the system in order for GTK_THEME to work.

In my Linux Mint installation I can select, e.g. "Clearlooks" in the GUI for the controls. Adding

export GTK_THEME=Clearlooks

before launching SmartGit has no effect - it still uses the system setting of Mint-X.

How do you actually manage the problems of different themes in combination with SWT? Do you suggest the users to switch their system theme? Do you abort the application with an error if a known buggy theme is detected?

SWT only officially supports the default GTK theme (Adwaita). A lot of themes follow the Adwaita style of declaring colors and other such things so it's usually not an issue, however there are exceptions. In these cases we do not try to fix issues in broken themes as there are no manpower/resources to do so. It's not really SWT's responsibility to fix broken GTK themes anyways.

From the user perspective it looks like the SWT-based applications are broken, because native applications simply work. Usually, users also don't want to change the system theme because it looks good for them and they might have selected it because they like it.

That said, if your theme is "difficult" and causes issues in SWT, you can feed some GTK CSS to SWT via the org.eclipse.swt.internal.gtk.cssFile property. SWT will load the CSS in this file at startup. I believe bug 527729 had some discussion on this matter.

Thanks you.

Quite related: why some controls, e.g. buttons, in native GTK applications look so different than the ones in a SWT application?

Attachment: linux-mint-17.1-industrial.png
Description: PNG image


Back to the top