SWT GTK Bug Affecting Grep Console

If you are using Grep Console with Eclipse Mars on a Linux system, you might have faced a strange issue: In certain versions of GTK, the Manage Expressions dialogue is empty – or rather, it shows the tree node expansion icons and the icons for enabling the individual expressions, but the labels and colour preview boxes are gone.

The reason for this is that with Eclipse Mars, SWT has switched from using GTK2 to using GTK3 by default. The GTK3 implementation of SWT still has some problems though, and one of them seems to be that the paint() method of an OwnerDrawLabelProvider is never called on some systems.

I’ve been able to reproduce this issue with Ubuntu 14.10, which uses libgtk3 3.12.2. The labels and icons do show up for me in Ubuntu 15.04 (with libgtk3 3.14.13), though there are some scaling issues there.

I’ve filed a bug report in the official Eclipse bug tracker. In the mean time, the best workaround is to tell Eclipse to use libgtk2. In fact, this may fix some other graphics issues as well. Andrey Loskutov describes how to do this:

Either call Eclipse with the shell variable SWT_GTK3 set to 0, e.g. like this:

SWT_GTK3=0 ./eclipse

Or change your eclipse.ini by adding two lines:

--launcher.GTK_version
2

Thanks to Florian Weitling and Marco for reporting this issue.

This entry was posted in Eclipse, Grep Console and tagged , , , . Bookmark the permalink.

2 Responses to SWT GTK Bug Affecting Grep Console

  1. Greg says:

    Hi,
    It seems this issue possibly applies to me. I’m using Mars (4.5) and I’m running Linux (Mint 17 Cinnamon). No matter what I do, I can’t seem to get the console entries to show in color. Per the above, I have added the “–launcher.GTK_version” entry to my eclipse.ini. Whereas previously I wasn’t seeing any text in the Expressions config section, now I do see “Log Output” and “Debug”, “Warn”, “Error”, “Fatal”, along with the appropriate color indicators. But I’m still not seeing any colors in the Console. Any thoughts on what I can do to fix this?
    Thanks for (what looks to be) a great plugin! (Just hope I’ll be able to use it.)
    All the best,
    Greg

  2. Greg says:

    Just want to add that Marian was able to help me with my problem. Though the “–launcher.GTK_version” change did cause the text entries to show up in the Expressions config dialog box (where previously they were not), I wasn’t seeing any colors in the Console because my regular expressions were wrong. After they were corrected, everything worked great. Thanks for the help!

Leave a Reply

Your email address will not be published. Required fields are marked *