summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe@ca.ibm.com>2012-02-24 17:26:27 -0500
committerBogdan Gheorghe <gheorghe@ca.ibm.com>2012-02-24 17:26:27 -0500
commit3844648ce466d6c74d37dc2642221732d31e3bc8 (patch)
treef0900317a078df1a57a6896a7b3ad280c9498d69 /bundles/org.eclipse.swt/Eclipse SWT/gtk
parentaac657b2cb99703918f845dbbad6bbb8f352d685 (diff)
downloadeclipse.platform.swt-3844648ce466d6c74d37dc2642221732d31e3bc8.tar.gz
eclipse.platform.swt-3844648ce466d6c74d37dc2642221732d31e3bc8.tar.xz
eclipse.platform.swt-3844648ce466d6c74d37dc2642221732d31e3bc8.zip
Bug 337979 - [ui] max/restore the editor area and viewstack tabs disappear
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java18
1 files changed, 18 insertions, 0 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 76bc7049e2..bed6612a0d 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
@@ -4213,6 +4213,7 @@ public boolean setParent (Composite parent) {
int /*long*/ topHandle = topHandle ();
int x = OS.GTK_WIDGET_X (topHandle);
int width = (state & ZERO_WIDTH) != 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle);
+ int height = (state & ZERO_HEIGHT) != 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle);
if ((this.parent.style & SWT.MIRRORED) != 0) {
x = this.parent.getClientWidth () - width - x;
}
@@ -4232,6 +4233,23 @@ public boolean setParent (Composite parent) {
int /*long*/ newParent = parent.parentingHandle();
OS.gtk_widget_reparent (topHandle, newParent);
OS.gtk_fixed_move (newParent, topHandle, x, y);
+ /*
+ * Restore the original widget size since GTK does not keep it.
+ */
+ resizeHandle(width, height);
+ /*
+ * Cause a size allocation this widget's topHandle. Note that
+ * all calls to gtk_widget_size_allocate() must be preceded by
+ * a call to gtk_widget_size_request().
+ */
+ GtkRequisition requisition = new GtkRequisition ();
+ gtk_widget_size_request (topHandle, requisition);
+ GtkAllocation allocation = new GtkAllocation ();
+ allocation.x = x;
+ allocation.y = y;
+ allocation.width = width;
+ allocation.height = height;
+ OS.gtk_widget_size_allocate (topHandle, allocation);
this.parent = parent;
setZOrder (null, false, true);
reskin (SWT.ALL);