Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Wagiaalla2014-08-13 14:44:28 +0000
committerArun Thondapu2014-08-14 14:55:31 +0000
commit551da5ae3ae7ab7adaad4cd4efa5cf0ec10a81b7 (patch)
tree105272f7f97f94beb185692fac1380635dd0d031
parentc574e45cd9662b6ff9d0ac44a16bcef94cccc411 (diff)
downloadeclipse.platform.swt-551da5ae3ae7ab7adaad4cd4efa5cf0ec10a81b7.tar.gz
eclipse.platform.swt-551da5ae3ae7ab7adaad4cd4efa5cf0ec10a81b7.tar.xz
eclipse.platform.swt-551da5ae3ae7ab7adaad4cd4efa5cf0ec10a81b7.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 a1e8dec419..d18e0477d1 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 {
@@ -660,7 +661,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