Bug 420889 - Shift+scroll wheel behavior broke
Summary: Shift+scroll wheel behavior broke
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 20.04.0
Platform: Arch Linux Linux
: VHI normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-05-02 08:49 UTC by Patrick
Modified: 2020-10-21 18:31 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.11.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick 2020-05-02 08:49:32 UTC
In previous versions of Okular, holding the shift key and using the mouse scroll wheel would scroll the page with one page/screen per step (like Page up/down). Using this method, you could quickly skip parts of (large) documents. In the latest version of Okular, this feature seems to be missing.
Comment 1 Nate Graham 2020-05-02 22:40:27 UTC
Can confirm. I didn't even know this feature existed!
Comment 2 Patrick 2020-10-16 14:18:20 UTC
The original shift+wheel behavior was handled by QAbstractSlider (in QAbstractSliderPrivate::scrollByDelta), which is inherited by QScrollBar and triggered by QAbstractScrollArea::wheelEvent.

Possible fix:

--- src/okular-20.08.2/ui/pageview.cpp	2020-10-05 08:26:20.000000000 +0200
+++ pageview.cpp	2020-10-16 14:59:28.407667911 +0200
@@ -3123,7 +3123,9 @@ void PageView::wheelEvent(QWheelEvent *e
                 d->scroller->scrollTo(QPoint(horizontalScrollBar()->value(), verticalScrollBar()->value()), 0); // sync scroller with scrollbar
             }
         } else {
-            if (delta != 0 && delta % QWheelEvent::DefaultDeltasPerStep == 0) {
+            if ((e->modifiers() & Qt::ShiftModifier) == Qt::ShiftModifier) {
+                QAbstractScrollArea::wheelEvent(e);
+            } else if (delta != 0 && delta % QWheelEvent::DefaultDeltasPerStep == 0) {
                 // number of scroll wheel steps Qt gives to us at the same time
                 int count = abs(delta / QWheelEvent::DefaultDeltasPerStep);
                 if (delta < 0) {
Comment 3 Nate Graham 2020-10-16 16:19:57 UTC
Thanks Patrick. That works great for me. Would you like to submit it as a merge request (targeting the `release/20.08` branch) at https://invent.kde.org/graphics/okular/-/merge_requests/? That would be lovely.

Here's the supporting documentation: https://community.kde.org/Infrastructure/GitLab
Comment 4 Nate Graham 2020-10-21 00:55:56 UTC
I guess not. I'll submit it myself then, but I'll use your authorship info.
Comment 5 Bug Janitor Service 2020-10-21 01:41:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/298
Comment 6 Patrick 2020-10-21 08:02:25 UTC
Ok, thanks.
Comment 7 Nate Graham 2020-10-21 18:31:09 UTC
Git commit 777ac37ea21212c4d924c75be5cee502ad5820c0 by Nate Graham.
Committed on 21/10/2020 at 17:52.
Pushed by ngraham into branch 'release/20.08'.

Fix fast scrolling with Shift+Scroll

When holding down the shift key, multiply wheel and touchpad scroll
distances by 10 to re-implement the fast scrolling feature that
broke when we added animated/smooth scrolling.
FIXED-IN: 1.11.3

M  +5    -2    ui/pageview.cpp

https://invent.kde.org/graphics/okular/commit/777ac37ea21212c4d924c75be5cee502ad5820c0