Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2012-07-17 16:19:46 +0000
committerSilenio Quarti2012-07-17 16:20:47 +0000
commita187354d39a8bd0bfd0b035b8db41e0943d6b46f (patch)
treef930f6b878bfa1cc13238bb0c5984f6178ff209f
parent477aa9eda338f67199b48e89b29378f8afcddb73 (diff)
downloadeclipse.platform.swt-a187354d39a8bd0bfd0b035b8db41e0943d6b46f.tar.gz
eclipse.platform.swt-a187354d39a8bd0bfd0b035b8db41e0943d6b46f.tar.xz
eclipse.platform.swt-a187354d39a8bd0bfd0b035b8db41e0943d6b46f.zip
Bug 382812 - Eclipse crashes with Gtk:ERROR after showing workbench (Ubuntu 10.10 amd64)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 7404d61334..ed2c7673d2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -4232,7 +4232,19 @@ public boolean setParent (Composite parent) {
oldDecorations.fixAccelGroup ();
}
int /*long*/ newParent = parent.parentingHandle();
- OS.gtk_widget_reparent (topHandle, newParent);
+
+ /*
+ * Bug in GTK. GTK will segment fault if gtk_widget_reparent() is called
+ * on a toolbar or on a widget hierarchy containing a toolbar. The fix is
+ * to reparent by removing the widget from its current parent and adding it
+ * to the new parent.
+ */
+// OS.gtk_widget_reparent(topHandle, newParent);
+ OS.g_object_ref (topHandle);
+ OS.gtk_container_remove (OS.gtk_widget_get_parent (topHandle), topHandle);
+ OS.gtk_container_add (newParent, topHandle);
+ OS.g_object_unref (topHandle);
+
OS.gtk_fixed_move (newParent, topHandle, x, y);
/*
* Restore the original widget size since GTK does not keep it.

Back to the top