summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-03-20 21:05:24 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-03-20 21:05:24 (GMT)
commit34ca2624ca9a2e0ce5a207e474ef6cff29b5e09e (patch)
treefd32fc0545a31df82ff49946f9c6d9456d9498a3 /library
parent67ede2610fad14fa22a131222c837134fe72c9f8 (diff)
downloadtk-34ca2624ca9a2e0ce5a207e474ef6cff29b5e09e.zip
tk-34ca2624ca9a2e0ce5a207e474ef6cff29b5e09e.tar.gz
tk-34ca2624ca9a2e0ce5a207e474ef6cff29b5e09e.tar.bz2
Fix [75d38f8608]: touchpad two finger scroll does not work correctly with listbox on Windows
Diffstat (limited to 'library')
-rw-r--r--library/listbox.tcl12
1 files changed, 10 insertions, 2 deletions
diff --git a/library/listbox.tcl b/library/listbox.tcl
index 1b35b3d..b39e703 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -195,10 +195,18 @@ if {[tk windowingsystem] eq "aqua"} {
}
} else {
bind Listbox <MouseWheel> {
- %W yview scroll [expr {- (%D / 120) * 4}] units
+ incr tk::Priv(wheel_acc_v_%W) %D
+ if {abs($tk::Priv(wheel_acc_v_%W)) >= 120} {
+ %W yview scroll [expr {- ($tk::Priv(wheel_acc_v_%W) / 120) * 4}] units
+ set tk::Priv(wheel_acc_v_%W) 0
+ }
}
bind Listbox <Shift-MouseWheel> {
- %W xview scroll [expr {- (%D / 120) * 4}] units
+ incr tk::Priv(wheel_acc_h_%W) %D
+ if {abs($tk::Priv(wheel_acc_h_%W)) >= 120} {
+ %W xview scroll [expr {- ($tk::Priv(wheel_acc_h_%W) / 120) * 4}] units
+ set tk::Priv(wheel_acc_h_%W) 0
+ }
}
}