summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-08-13 13:41:07 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-08-13 15:23:22 -0400
commitc355f6891c71dea091557f57d6c197397a859867 (patch)
treecd1f1dd428c709f40dda0d7c281479f3db7f23e8
parente9be3e91d3c2970f6e13d3741d31907f820e9150 (diff)
downloadeclipse.platform.swt-c355f6891c71dea091557f57d6c197397a859867.tar.gz
eclipse.platform.swt-c355f6891c71dea091557f57d6c197397a859867.tar.xz
eclipse.platform.swt-c355f6891c71dea091557f57d6c197397a859867.zip
Solves bug in Sash widget (caused by path in bug #386401)
-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);