Bug 491243 - Buggy "smooth scrolling" behaviour during initial load of a PDF
Summary: Buggy "smooth scrolling" behaviour during initial load of a PDF
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 24.05.2
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-04 03:11 UTC by Stephan Sokolow
Modified: 2024-08-04 03:16 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Sokolow 2024-08-04 03:11:26 UTC
SUMMARY

With smooth scrolling disabled, when I open a PDF in Okular, for the first [variable amount of time] before the document "stabilizes", I have to deal with pages slowly sliding upward by several lines of text from where I want them to be once I finish spinning the scroll wheel.

As a programmer with no experience with the Okular codebase, my intuition is saying "Is there some kind of scroll-position race condition that happens if I scroll while the document is still loading/rendering something, which is then getting eased via some bit of smooth scrolling code that ignores the enable/disable checkbox?"

STEPS TO REPRODUCE

1. Uncheck Appearance → Use Smooth Scrolling (to optimize for perceived snappiness instead of bling)
2. Load a long PDF like the electronic copy of Programming Starter Kit of Macintosh that was included on various vintage CodeWarrior Reference CDs. (860 pages. The fact that it's not just a package of JPEG page scans may also be relevant.)
2. Start scrolling as soon as pages start to render in (so you can see what you're doing) but without waiting for the whole document's page thumbnails to render or whatever else Okular is doing that takes a while.

OBSERVED RESULT

Whether scrolling up or down, when I stop spinning the scroll wheel, the viewport slowly "slides down" (i.e. the document slides up) by three to five rows of text from where I tried to put it.

EXPECTED RESULT

As soon as the scroll wheel stops being spun, the scrolling should stop and stay there.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04.4 LTS
KDE Plasma Version: 5.24.7 (Host)
KDE Frameworks Version: 5.92.0 (Host) / 6.4.0 (Okular Flatpak)
Qt Version: 5.15.3 (Host) / 6.7.2 (Okular Flatpak)

ADDITIONAL INFORMATION

I know that FocusWriter had a "bug" in its theme selector that turned out to be "Qt 6 defaults to single-click-to-activate and listens to different settings than the ones Plasma 5.x System Settings sets", so, for all I know, this *could* be another "Qt 6 on KDE 5" bug... but it seems more likely this is just "Disabling smooth scrolling doesn't get enough testing".
Comment 1 Stephan Sokolow 2024-08-04 03:16:28 UTC
Actually, now that I think about it, in Okular and Firefox, I don't disable smooth scrolling *just* to optimize for perceived snappiness, it's also because I like to align my viewport just so, and smooth scrolling destroys the instantaneous feedback on whether I need more or fewer scroll steps to achieve my goal or forces me to switch from scroll-wheeling on an un-focused window on a secondary monitor to using grab-drag panning and then re-focusing gVim on my primary monitor to resume typing.

(How do Windows people LIVE without being able to send scroll-wheel events unfocused windows? :P )