Skip to content

Commit

Permalink
Proposed fix for [73c5e3ad3]: Two potentially bogus binding scripts f…
Browse files Browse the repository at this point in the history
…or <TouchpadScroll>
  • Loading branch information
jan.nijtmans committed Oct 15, 2024
1 parent c1b0cc0 commit ce27f02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
17 changes: 8 additions & 9 deletions library/listbox.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,14 @@ bind Listbox <Shift-Option-MouseWheel> {
tk::MouseWheel %W x %D -12.0 units
}
bind Listbox <TouchpadScroll> {
if {%# %% 5 != 0} {
return
}
lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY)
if {$tk::Priv(deltaX) != 0} {
%W xview scroll [expr {-$tk::Priv(deltaX)}] units
}
if {$tk::Priv(deltaY) != 0} {
%W yview scroll [expr {-$tk::Priv(deltaY)}] units
if {%# %% 5 == 0} {
lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY)
if {$tk::Priv(deltaX) != 0} {
%W xview scroll [expr {-$tk::Priv(deltaX)}] units
}
if {$tk::Priv(deltaY) != 0} {
%W yview scroll [expr {-$tk::Priv(deltaY)}] units
}
}
}

Expand Down
17 changes: 8 additions & 9 deletions library/ttk/utils.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,14 @@ bind TtkScrollable <Shift-Option-MouseWheel> \
## Touchpad scrolling
#
bind TtkScrollable <TouchpadScroll> {
if {%# %% 5 != 0} {
return
}
lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY)
if {$tk::Priv(deltaX) != 0} {
%W xview scroll [expr {-$tk::Priv(deltaX)}] units
}
if {$tk::Priv(deltaY) != 0} {
%W yview scroll [expr {-$tk::Priv(deltaY)}] units
if {%# %% 5 == 0} {
lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY)
if {$tk::Priv(deltaX) != 0} {
%W xview scroll [expr {-$tk::Priv(deltaX)}] units
}
if {$tk::Priv(deltaY) != 0} {
%W yview scroll [expr {-$tk::Priv(deltaY)}] units
}
}
}
#*EOF*

0 comments on commit ce27f02

Please sign in to comment.