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

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.


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.

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.


MfG,

--
Eric Williams
Software Engineer - Eclipse/SWT Team
Red Hat


Back to the top