diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 20 |
1 files changed, 17 insertions, 3 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 83d1920130..209fadab90 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 @@ -4190,12 +4190,26 @@ void setInitialBounds () { * expected by SWT. */ int /*long*/ topHandle = topHandle (); + GtkAllocation allocation = new GtkAllocation(); if ((parent.style & SWT.MIRRORED) != 0) { - OS.GTK_WIDGET_SET_X (topHandle, parent.getClientWidth ()); + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + allocation.x = parent.getClientWidth (); + } else { + OS.GTK_WIDGET_SET_X (topHandle, parent.getClientWidth ()); + } + } else { + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + allocation.x = 0; + } else { + OS.GTK_WIDGET_SET_X (topHandle, 0); + } + } + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + allocation.y = 0; + OS.gtk_widget_set_allocation(topHandle, allocation); } else { - OS.GTK_WIDGET_SET_X (topHandle, 0); + OS.GTK_WIDGET_SET_Y (topHandle, 0); } - OS.GTK_WIDGET_SET_Y (topHandle, 0); } else { resizeHandle (1, 1); forceResize (); |