summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2006-08-29 19:41:58 +0000
committerSteve Northover <steve>2006-08-29 19:41:58 +0000
commit7251d4fc95dcfbef0bd04c4c2dffd64175e2917b (patch)
tree6368aabca41a7b5012687cdd4162ca94da506402
parent3113bc0bde5454496eed1de20599a092a2f666fe (diff)
downloadeclipse.platform.swt-7251d4fc95dcfbef0bd04c4c2dffd64175e2917b.tar.gz
eclipse.platform.swt-7251d4fc95dcfbef0bd04c4c2dffd64175e2917b.tar.xz
eclipse.platform.swt-7251d4fc95dcfbef0bd04c4c2dffd64175e2917b.zip
110163 - X Window System error, using Swing system look and feel, rendering SVG using SWT_AWT in non-top stack layout
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java
index ebb87bb219..ea3070bf9f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java
@@ -15,7 +15,8 @@ import java.lang.reflect.Method;
/* SWT Imports */
import org.eclipse.swt.*;
-import org.eclipse.swt.internal.Library;
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.gtk.*;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Shell;
@@ -77,6 +78,16 @@ static synchronized void loadLibrary () {
static synchronized void initializeSwing() {
if (swingInitialized) return;
swingInitialized = true;
+ /*
+ * Feature in GTK. The default X error handler
+ * for GTK calls exit() after printing the X error.
+ * Normally, this isn't that big a problem for SWT
+ * applications because they don't cause X errors.
+ * However, sometimes X errors are generated by AWT
+ * that make SWT exit. The fix is to hide all X
+ * errors when AWT is running.
+ */
+ OS.gdk_error_trap_push();
try {
/* Initialize the default focus traversal policy */
Class[] emptyClass = new Class[0];