Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
index 7485d194c6..c5f7d7e901 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
@@ -393,6 +393,9 @@ int /*long*/ gtk_motion_notify_event (int /*long*/ widget, int /*long*/ eventPtr
int y = 0;
int width = 0;
int height = 0;
+ int parentBorder = 0;
+ int parentWidth = 0;
+ int parentHeight = 0;
GtkAllocation allocation = new GtkAllocation ();
if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
OS.gtk_widget_get_allocation(handle, allocation);
@@ -400,15 +403,17 @@ int /*long*/ gtk_motion_notify_event (int /*long*/ widget, int /*long*/ eventPtr
y = allocation.y;
width = allocation.width;
height = allocation.height;
+ OS.gtk_widget_get_allocation(parent.handle, allocation);
+ parentWidth = allocation.width;
+ parentHeight = allocation.height;
} else {
x = OS.GTK_WIDGET_X (handle);
y = OS.GTK_WIDGET_Y (handle);
width = OS.GTK_WIDGET_WIDTH (handle);
height = OS.GTK_WIDGET_HEIGHT (handle);
+ parentWidth = OS.GTK_WIDGET_WIDTH (parent.handle);
+ parentHeight = OS.GTK_WIDGET_HEIGHT (parent.handle);
}
- int parentBorder = 0;
- int parentWidth = OS.GTK_WIDGET_WIDTH (parent.handle);
- int parentHeight = OS.GTK_WIDGET_HEIGHT (parent.handle);
int newX = lastX, newY = lastY;
if ((style & SWT.VERTICAL) != 0) {
newX = Math.min (Math.max (0, eventX + x - startX - parentBorder), parentWidth - width);

Back to the top