Bug 565426 - [Win32] Smooth scrolling doesn't work with SWT.CANVAS
Summary: [Win32] Smooth scrolling doesn't work with SWT.CANVAS
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.17 M3   Edit
Assignee: Alexandr Miloslavskiy CLA
QA Contact: Niraj Modi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-22 08:21 EDT by Alexandr Miloslavskiy CLA
Modified: 2022-01-31 09:42 EST (History)
3 users (show)

See Also:


Attachments
Test snippet (1.20 KB, application/octet-stream)
2020-07-22 08:25 EDT, Alexandr Miloslavskiy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Miloslavskiy CLA 2020-07-22 08:21:49 EDT
The problem is that `WM_MOUSEWHEEL` that is not a multiple of `OS.WHEEL_DELTA`. SWT merely divides amount by `OS.WHEEL_DELTA`, causing all fractional scrolling to be lost. Is user scrolls slowly, there is no scrolling at all.

It was fixed very long ago via Bug 194143, where SWT started accumulating fractional scrolling. However, quickly after that, the patch was (accidentally?) negated by Bug 184063.
Comment 1 Alexandr Miloslavskiy CLA 2020-07-22 08:25:40 EDT
Created attachment 283673 [details]
Test snippet

Note that this test snippet only shows problems with mouse/touchpad devices that implement smooth scrolling. Other devices (probably the majority of all devices on market) always scroll in multiples of `OS.WHEEL_DELTA`.
Comment 2 Eclipse Genie CLA 2020-07-22 15:36:04 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/166675
Comment 3 Eclipse Genie CLA 2020-07-22 15:36:07 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/166676
Comment 4 Alexandr Miloslavskiy CLA 2020-07-22 15:54:34 EDT
Many touchpads will simulate mouse wheel if you drag two fingers over it.
Comment 7 Niraj Modi CLA 2020-08-06 05:06:46 EDT
(In reply to Eclipse Genie from comment #5)
> Gerrit change
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/166675 was
> merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=d56087d829a58cb54ccd23f2a8593c4d8f632f62

(In reply to Eclipse Genie from comment #6)
> Gerrit change
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/166676 was
> merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=fc90bbad46fa9c14ca3b5476a825ad76746d7aa7

Thanks Alexandr for the fix patches, resolving now.
Comment 8 Alexandr Miloslavskiy CLA 2020-08-07 11:10:04 EDT
Thanks for reviewing!
Comment 9 Alexandr Miloslavskiy CLA 2020-08-18 13:16:57 EDT
Verified in I20200818-0900 (using test snippet 'Bug565426_SmoothScrolling'):
* Partial scrolling now works as expected.