diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 14 |
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. |