diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-08-13 13:41:07 -0400 |
---|---|---|
committer | Anatoly Spektor <aspektor@redhat.com> | 2012-08-13 13:41:07 -0400 |
commit | 35c4632119cceb3d28cde365e786564fe0d4f502 (patch) | |
tree | 88ed472bc4fa740e3f02badda99c6b0450d082ef | |
parent | e2eec58f5a7bca2908e0116758c3fe8312d273e1 (diff) | |
download | eclipse.platform.swt-gtk_widget_get_allocation__.tar.gz eclipse.platform.swt-gtk_widget_get_allocation__.tar.xz eclipse.platform.swt-gtk_widget_get_allocation__.zip |
Solves bug in Sash widget (caused by path in bug #386401)gtk_widget_get_allocation__
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java | 11 |
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 0da5238e18..3a40f493dc 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); |