Don't let 'ScrollEffect.reset()' set 'is_manual' to True #7775
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Maintainer merge checklist
Component: xxx
label.api-deprecation
orapi-break
label.release-highlight
label to be highlighted in release notes.versionadded
,versionchanged
as needed.Fixes #7721.
This is a substitute for #7727.
The cause of the issue
KineticEffect.is_manual
should be True only when there is a touch performing a scroll. But under a certain circumstance, it can be True even though no touch events are in progress. You can confirm it by watching theis_manual
property while running the #7721 example and resizing the window like shown in the #7721 video.issue7721.mp4
Because of that, ScrollView uses its previous size while re-positioning its content when it gets resized. The following code is where it happens.
kivy/kivy/uix/scrollview.py
Lines 624 to 627 in 315b742
kivy/kivy/uix/scrollview.py
Lines 639 to 642 in 315b742
How is_manual ends up being True after a touch performing a scroll ends
is_manual
is set to FalseScrollEffect.value
will be updated for a while.ScrollEffect.value
exceeds the bounds(ScrollEffect.min
,ScrollEffect.max
),ScrollEffect.reset()
gets called andis_manual
will be set to True.Why the issue doesn't occur when DampedScrollEffect is being used
It overwrites on_value() but doesn't call
super().on_value()
, which is the one who callsreset()
.kivy/kivy/effects/scroll.py
Lines 96 to 109 in fe9cd88