Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Wagiaalla2014-08-13 14:44:28 +0000
committerSami Wagiaalla2014-08-13 15:44:07 +0000
commite221e17eab2d3a2fe8fa3f815e7df1b6bbd62b20 (patch)
tree7916add063b3ba9928741b83df0eb01e2ba23507
parent7ae87fa2369a173c86775bf851b6afd6ea5a77e3 (diff)
downloadeclipse.platform.swt-e221e17eab2d3a2fe8fa3f815e7df1b6bbd62b20.tar.gz
eclipse.platform.swt-e221e17eab2d3a2fe8fa3f815e7df1b6bbd62b20.tar.xz
eclipse.platform.swt-e221e17eab2d3a2fe8fa3f815e7df1b6bbd62b20.zip
Bug 441705 - Check cairo version to enable USE_CAIRO
org.eclipse.swt.widgets.Caret uses CAIRO_OPERATOR_DIFFERENCE when OS.USE_CAIRO is true but that operator is not introduced until cairo 1.9.4. OS.USE_CAIRO is set based on the GTK version which leads the boolean to be enabled on systems where GTK >= 2.24 and if cairo is < 1.9.4 eclipse crashes. This patch checks the cairo version when enabling cairo. Change-Id: I183adafba7ed95da0c6ec1cf05b8a52b7428b1ca Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 907a02f08e..3878fd9326 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -17,6 +17,7 @@ package org.eclipse.swt.internal.gtk;
import org.eclipse.swt.internal.C;
import org.eclipse.swt.internal.Library;
+import org.eclipse.swt.internal.cairo.Cairo;
public class OS extends C {
static {
@@ -658,7 +659,8 @@ public class OS extends C {
static {
boolean useCairo = false;
if (!"false".equals(System.getProperty("org.eclipse.swt.internal.gtk.cairoGraphics"))) {
- useCairo = GTK_VERSION >= VERSION(2, 24, 0);
+ useCairo = GTK_VERSION >= VERSION(2, 24, 0) &&
+ Cairo.cairo_version() >= Cairo.CAIRO_VERSION_ENCODE(1, 9, 4);
}
USE_CAIRO = useCairo || OS.GTK3;
boolean initCairo = false;

Back to the top