Page MenuHomeFreeBSD

Add natural scrolling support to psm.
ClosedPublic

Authored by nyan_myuji.xyz on May 28 2019, 5:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 1:56 PM
Unknown Object (File)
Fri, Dec 13, 1:33 AM
Unknown Object (File)
Tue, Dec 3, 1:08 AM
Unknown Object (File)
Fri, Nov 29, 12:24 PM
Unknown Object (File)
Thu, Nov 28, 10:04 PM
Unknown Object (File)
Nov 24 2024, 1:21 PM
Unknown Object (File)
Oct 17 2024, 8:46 PM
Unknown Object (File)
Oct 8 2024, 9:30 AM
Subscribers

Details

Summary

Natural scrolling is one of the features that is not covered in https://wiki.freebsd.org/SynapticsTouchpad with moused.

This patch enables natural scrolling in vertical and horizontal direction with two finger scroll enabled and when user is using a trackpad (mouse and trackpoint are not affected) by adding two sysctl that can each enabled/disable natural scrolling in one of the direction with using trackpad.

Test Plan

Tested on Thinkpad X1 Extreme.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/atkbdc/psm.c
5753 ↗(On Diff #58002)

I think we should have a /* FALLTHROUGH */ here (and following line) per https://man.freebsd.org/style/9

Hi Nyan,
Could you upload the diff as fullcontext diff next time. See https://wiki.freebsd.org/Phabricator

git diff -U999999 other-branch > change.diff
git show -U999999 <commit-hash> > change.diff
svn diff --diff-cmd=diff -x -U999999 > change.diff`

It is not necessary to reupload current diff

sys/dev/atkbdc/psm.c
4336 ↗(On Diff #58002)

Are there any reasons to limit axis inversion to two finger scrolling only?

4337 ↗(On Diff #58002)

IMO this operation can be simplified with using of logical XOR:
ms->button |= ((dyp > 0) != (two_finger_scroll && natural_ver_scroll)) ?

5753 ↗(On Diff #58002)

"Do nothing" fallthrough cases does not require explicit /* FALLTHROUGH */ . See style(9) getopt() example, case '?':

sys/dev/atkbdc/psm.c
5753 ↗(On Diff #58002)

Oh that's right, sorry for the noise.

In D20447#441492, @wulf wrote:

Hi Nyan,
Could you upload the diff as fullcontext diff next time. See https://wiki.freebsd.org/Phabricator

git diff -U999999 other-branch > change.diff
git show -U999999 <commit-hash> > change.diff
svn diff --diff-cmd=diff -x -U999999 > change.diff`

It is not necessary to reupload current diff

Ah my bad, will pay attention next time.

sys/dev/atkbdc/psm.c
4336 ↗(On Diff #58002)

This is because when two finger scrolling is disabled, virtual scrolling from dedicated area, which has an expected behavour of "move to the direction the scroll bar goes",

When the option is activated but without two finger scrolling enabled, the normal virtual scroll from dedicated area will get inverted as will, which implies that the scrolling direction from the dedicated area will be opposite to the direction of the scroll bar.

This revision is now accepted and ready to land.May 29 2019, 8:28 PM

One more question:

Why ver and hor sysctls are added separately?

I think single "natural_scroll" is enough.

In D20447#442373, @wulf wrote:

One more question:

Why ver and hor sysctls are added separately?

I think single "natural_scroll" is enough.

There are not much good reasons but was just because I was thinking that this will be a bit more flexible.

This revision was automatically updated to reflect the committed changes.

Given the fact that horizontal scrolling with sysmouse protocol is not supported by userland software out of boх, I joined both hor & ver sysctls into common "natural_scroll" one to not confuse users.