Invert the scroll direction for wheel events on internal windows
ClosedPublic

Authored by graesslin on Nov 3 2016, 12:12 PM.

Details

Summary

For whatever reason Qt scrolled the wrong way on internal windows. As a
new QWheelEvent is constructed anyway, just multiply by -1 to get the
direction fixed.

BUG: 371999
FIXED-IN: 5.8.4

Test Plan

Tried debug console in nested setup, scrolled correctly now.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 7859.Nov 3 2016, 12:12 PM
graesslin retitled this revision from to Invert the scroll direction for wheel events on internal windows.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptNov 3 2016, 12:12 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
broulik edited edge metadata.Nov 3 2016, 1:16 PM

How does that affect horizontal scrolling? Also, does that already take into account scroll direction "natural"/normal (or was that maybe the case for it being wrong in the first place?)?

How does that affect horizontal scrolling?

The same: as we multiple by -1 it's also corrected now. Though I admit to not have tested it (yet)

Also, does that already take into account scroll direction "natural"/normal (or was that maybe the case for it being wrong in the first place?)?

The cause in the first place is that Qt expects the delta in another dimension. I just verified by looking at Qt code and there it's also multiplied by a negative value: https://code.qt.io/cgit/qt/qtwayland.git/tree/src/client/qwaylandinputdevice.cpp#n557

broulik accepted this revision.Nov 3 2016, 8:00 PM
broulik edited edge metadata.

Verified that horizontal scrolling also scrolls correctly (dragged one TreeWidget colum super wide to have it scroll)

This revision is now accepted and ready to land.Nov 3 2016, 8:00 PM
This revision was automatically updated to reflect the committed changes.