]> git.ipfire.org Git - thirdparty/git.git/commit
gitk: fix trackpad scrolling for Tcl/Tk 8.7+
authorRuoyu Zhong <zhongruoyu@outlook.com>
Wed, 27 Aug 2025 02:12:19 +0000 (10:12 +0800)
committerRuoyu Zhong <zhongruoyu@outlook.com>
Wed, 27 Aug 2025 03:42:30 +0000 (11:42 +0800)
commit432669914b2fb812bc62e3b52176a8bfc8e4d667
treea34e78ac14b245a02ca612710f3a63ee7c27c3bc
parentbe1829c0fd55ae2f7851c0c610c716cc5154dc5c
gitk: fix trackpad scrolling for Tcl/Tk 8.7+

TIP 684 [1] introduced TouchpadScroll events in Tcl/Tk 8.7, separating
trackpad gestures from traditional MouseWheel events. This broke
trackpad scrolling in gitk where trackpads generate TouchpadScroll
events instead of MouseWheel events.

Fix that by adding TouchpadScroll event bindings for all scrollable
widgets following the TIP 684 specification. Implement a new
precisescrollval proc to handle the smaller delta values from
TouchpadScroll events, using appropriate scaling factors that seem
sensible on my MacBook.

Fixes https://github.com/j6t/gitk/issues/31.

[1]: https://core.tcl-lang.org/tips/doc/main/tip/684.md

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
gitk