diff options
| author | Eric Williams | 2018-04-09 18:19:24 +0000 |
|---|---|---|
| committer | Eric Williams | 2018-04-09 20:06:04 +0000 |
| commit | 08e087b2294d547e33246d957891edc34a1974ea (patch) | |
| tree | 2db023feb3011ceebbb2888f7ec2e75a3d10437c | |
| parent | 28f9fc35454024eb2bc295cace0336cec9a70cc5 (diff) | |
| download | eclipse.platform.swt-08e087b2294d547e33246d957891edc34a1974ea.tar.gz eclipse.platform.swt-08e087b2294d547e33246d957891edc34a1974ea.tar.xz eclipse.platform.swt-08e087b2294d547e33246d957891edc34a1974ea.zip | |
Bug 522140: [GTK3] Horizontal SashForm resize problem
Use lastX instead of rect.x in Sash.gtk_motion_notify_event(). LastX is
set to rect.x only when event.doit is true, which is the case in 99% of
use cases. However when resizing quickly, event.doit is not true, so
calling setBounds() on rect.x is incorrect.
Using lastX checks for event.doit which avoids this bug by not calling
setBounds() with rect.x as the x coordinate.
Tested on GTK3.22 in the IDE and ControlExample. No AllNonBrowser JUnit
tests fail.
Change-Id: I4661cae8df947a953e273b48d851254579fd163b
Signed-off-by: Eric Williams <ericwill@redhat.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java | 6 |
1 files changed, 5 insertions, 1 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 e649080f4e..d9d91211cc 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 @@ -413,7 +413,11 @@ long /*int*/ gtk_motion_notify_event (long /*int*/ widget, long /*int*/ eventPtr parent.update (true, (style & SWT.SMOOTH) == 0); drawBand (lastX, lastY, width, height); if ((style & SWT.SMOOTH) != 0) { - setBoundsInPixels (rect.x, lastY, width, height); + /* + * Use lastX instead of rect.x, as lastX takes into account + * the event.doit flag. See bug 522140. + */ + setBoundsInPixels (lastX, lastY, width, height); // widget could be disposed at this point } return result; |
