diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java index 1ef9cfdba7..b1e3bbd1f9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java @@ -166,14 +166,32 @@ public Rectangle computeTrim (int x, int y, int width, int height) { checkWidget(); forceResize (); int /*long*/ clientHandle = clientHandle (); - int clientX = OS.GTK_WIDGET_X (clientHandle); - int clientY = OS.GTK_WIDGET_Y (clientHandle); + int clientX = 0; + int clientY = 0; + GtkAllocation allocation = new GtkAllocation (); + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + OS.gtk_widget_get_allocation(clientHandle, allocation); + clientX = allocation.x; + clientY = allocation.y; + } else { + clientX = OS.GTK_WIDGET_X (clientHandle); + clientY = OS.GTK_WIDGET_Y (clientHandle); + } x -= clientX; y -= clientY; width += clientX + clientX; if ((style & SWT.BOTTOM) != 0) { - int parentHeight = OS.GTK_WIDGET_HEIGHT (handle); - int clientHeight = OS.GTK_WIDGET_HEIGHT (clientHandle); + int parentHeight = 0; + int clientHeight = 0; + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + OS.gtk_widget_get_allocation(clientHandle, allocation); + clientHeight = allocation.height; + OS.gtk_widget_get_allocation(handle, allocation); + parentHeight = allocation.height; + } else { + parentHeight = OS.GTK_WIDGET_HEIGHT (handle); + clientHeight = OS.GTK_WIDGET_HEIGHT (clientHandle); + } height += parentHeight - clientHeight; } else { height += clientX + clientY; |