summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java32
1 files changed, 8 insertions, 24 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
index c08b0f3994..89f5371ec5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
@@ -204,23 +204,12 @@ public Rectangle getClientArea () {
checkWidget ();
forceResize ();
int /*long*/ clientHandle = clientHandle ();
- int x = 0;
- int y = 0;
- int width = 0;
- int height = 0;
GtkAllocation allocation = new GtkAllocation ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
- OS.gtk_widget_get_allocation(clientHandle, allocation);
- x = allocation.x;
- y = allocation.y;
- width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
- height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height;
- } else {
- x = OS.GTK_WIDGET_X (clientHandle);
- y = OS.GTK_WIDGET_Y (clientHandle);
- width = (state & ZERO_WIDTH) != 0 ? 0 : OS.GTK_WIDGET_WIDTH (clientHandle);
- height = (state & ZERO_HEIGHT) != 0 ? 0 : OS.GTK_WIDGET_HEIGHT (clientHandle);
- }
+ gtk_widget_get_allocation (clientHandle, allocation);
+ int x = allocation.x;
+ int y = allocation.y;
+ int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
+ int height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height;
return new Rectangle (x, y, width, height);
}
/**
@@ -378,14 +367,9 @@ void redrawWidget (int x, int y, int width, int height, boolean redrawAll, boole
GdkRectangle rect = new GdkRectangle ();
if (redrawAll) {
GtkAllocation allocation = new GtkAllocation ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
- OS.gtk_widget_get_allocation(topHandle, allocation);
- rect.width = allocation.width;
- rect.height = allocation.height;
- } else {
- rect.width = OS.GTK_WIDGET_WIDTH (topHandle);
- rect.height = OS.GTK_WIDGET_HEIGHT (topHandle);
- }
+ gtk_widget_get_allocation (topHandle, allocation);
+ rect.width = allocation.width;
+ rect.height = allocation.height;
} else {
int [] destX = new int [1], destY = new int [1];
OS.gtk_widget_translate_coordinates (paintHandle, topHandle, x, y, destX, destY);