Skip to content

fix: mouse wheel responds on the first tick after a direction change - #21807

Open
Arecsu wants to merge 1 commit into
darktable-org:masterfrom
Arecsu:fix/mouse-wheel-direction-lag
Open

fix: mouse wheel responds on the first tick after a direction change#21807
Arecsu wants to merge 1 commit into
darktable-org:masterfrom
Arecsu:fix/mouse-wheel-direction-lag

Conversation

@Arecsu

@Arecsu Arecsu commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Mouse wheel scrolling of bauhaus sliders and dropdowns ignored the first tick after a direction change: scroll down three notches, then one notch up — the up notch does nothing, and only the second one moves the value back. Same in reverse, and it affects dropdown popups and the alt/ctrl/shift zoom-range shortcuts too.

The new discrete scroll proxy accumulates attenuated wheel deltas and only emits a step once the accumulator crosses ±1.0, keeping the fractional remainder from the previous direction. On a direction change that remainder has to be cancelled first, so the first tick of the new direction is spent doing nothing. Released versions handled mouse wheel notches as exact ±1 cardinal events that never went through the accumulator, which is why this never happened before.

The fix drops the accumulated remainder as soon as the incoming delta changes sign:

  • The controller proxy (bauhaus sliders, dropdowns, and their popups) now responds to the first tick in the new direction.
  • dt_gui_get_scroll_unit_deltas() (thumbtable, gradientslider, darkroom scroll-zoom, scroll shortcuts) gets the same handling for smooth/touchpad input, which had the identical lag.

No behavior changes for scrolling within a single direction.

Could fix #21390

The discrete scroll accumulators (both the event controller proxy used
by bauhaus sliders/dropdowns and dt_gui_get_scroll_unit_deltas) kept the
signed fractional remainder from the previous scroll direction.  After
reversing direction, the first tick was silently spent cancelling that
stale remainder, so it did nothing and a second tick was needed before
the value changed.

Drop the accumulated remainder when the incoming scroll delta changes
sign, so the new direction takes effect on its very first tick.
@Arecsu

Arecsu commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Need help to test if this solves #21390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameter slider scroll misbehavior

1 participant