This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 238681 - problem with swt cairo
problem with swt cairo
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: eclipse (Show other bugs)
6
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ben Konrath
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-02 05:18 EDT by Christoph Höger
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 3.2.2-7.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-05 15:56:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Christoph Höger 2007-05-02 05:18:30 EDT
Description of problem:
When I tried to fix a bug in eclipse-gmf (which is filed under
https://www.eclipse.org/bugs/show_bug.cgi?id=159840 )
I stumpled upon libcairo-swt.so missing in my system, which should be located
under /usr/lib/eclipse.

Version-Release number of selected component (if applicable):
eclipse-platform-3.2.2-2.fc6

I'm not quite sure if this is actually a bug or a feature (like someone moved
that lib) but it seems that there are eclipse plugins that rely on libcairo-swt.
Please correct me, if I'm wrong, but I think this library is actually missing.
Comment 1 Ben Konrath 2007-05-02 08:12:21 EDT
You're right, it's missing. It's something I need to sort out - actually I'm not
even sure what it does or which plugins use it. Any help would be appreciated.
Comment 2 Christoph Höger 2007-05-02 10:42:02 EDT
Hi,

I just tried and took libcairo-swt.so from the official stable eclipse-swt
release. Using the LD_PRELOAD Directive a could workaround the original bug.
There are still some display bugs, but it works.

The reason libcairo-swt.so is needed is, that some swt applications make use of
fancy features, like anti-aliasing and stuff. To do that swt uses cairo. So
libcairo-swt.so is probably the swt binding for cairo and should be included in
the fedora rpm AFAP (IMHO). 

Next Step would be to look for the bug I mentioned and track it down. This bug
has to do something with library conflicts.
 
Comment 3 Ben Konrath 2007-05-07 02:52:04 EDT
(In reply to comment #2)
> The reason libcairo-swt.so is needed is, that some swt applications make use of
> fancy features, like anti-aliasing and stuff. To do that swt uses cairo. So
> libcairo-swt.so is probably the swt binding for cairo and should be included in
> the fedora rpm AFAP (IMHO). 

I looked into this a little and I don't think that we should be including
libcairo-swt.so. It seems that libcario-swt.so is a fall back version of cairo
in case the system cairo doesn't load or isn't available:

void checkCairo() {
	if (CAIRO_LOADED) return;
	try {
		/* Check if cairo is available on the system */
		byte[] buffer = Converter.wcsToMbcs(null, "libcairo.so.2", true);
		int /*long*/ libcairo = OS.dlopen(buffer, OS.RTLD_LAZY);
		if (libcairo != 0) {
			OS.dlclose(libcairo);
		} else {
			try {
				System.loadLibrary("cairo-swt");
			} catch (UnsatisfiedLinkError e) {
				/* Ignore problems loading the fallback library */
			}
		}
		Class.forName("org.eclipse.swt.internal.cairo.Cairo");
		CAIRO_LOADED = true;
	} catch (Throwable t) {
		SWT.error(SWT.ERROR_NO_GRAPHICS_LIBRARY, t, " [Cairo is required]");
	}
}

from:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt/Eclipse%20SWT/gtk/org/eclipse/swt/graphics/Device.java?revision=1.57&view=markup&pathrev=v3236b

Perhaps the system cairo is not loading with our packages. Can you provide test
case that demonstrates that cairo isn't loading? - a series of steps or actions
should be fine. Thanks.
Comment 4 Christoph Höger 2007-05-07 07:39:43 EDT
The library is obviously loaded:

java    4502 choeger  mem    REG        8,6   439820 1792087
/usr/lib/libcairo.so.2.9.3

The problem seems to be the use of AA and such things. Perhaps it is some kind
of version problem.
Comment 5 Ben Konrath 2007-05-16 03:46:35 EDT
Can you provide a serise of steps I can do to see the problem?
Comment 6 Christoph Höger 2007-05-22 13:29:30 EDT
Hi,

sorry for the late answer, here are the steps

1. take fresh fedora eclipse
2. install gmf from callisto update site (hence there is no fedora rpm)
3. create (or load a sample) .ecore diagram using emf ecore editor
4. choose "initialice ecore_diagram" in its context menu
5. you won't see anything, were a nice UML diagram should be

this is essentially the bug that is filed in eclipses bugzilla (see above)

if you
1. start eclipse with LD_PRELOAD=libcairo-swt.so
2. open the same diagram in the gmf editor
3. you see (a bit ugly) the UML diagram
Comment 7 Ben Konrath 2007-06-04 01:57:43 EDT
Ok, I think you're hitting this bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=150357

I should be able to add a patch to swt to fix this. I'll report back when I have
a set of packages that need testing. Thanks, Ben
Comment 8 Ben Konrath 2007-06-07 01:03:36 EDT
Updated packages have been released to updates-testing. Please test these
packages and report back. You can install the updated packages with:

sudo yum --enablerepo=updates-testing install eclipse-sdk

Thanks, Ben
Comment 9 Christoph Höger 2007-06-07 10:12:30 EDT
Hey,

great! The gfx work perfectly.

thank you!

Note You need to log in before you can comment on or make changes to this bug.