Skip to content

Commit

Permalink
Fix #324840: Ctrl+Scrollwheel zoom on Linux X11
Browse files Browse the repository at this point in the history
With recent libinput versions zooming with Ctrl+Scrollwheel would zoom
in huge steps. This change enforces the previous behavior for Linux X11
only.

Scrolling is left unchanged for Wayland
  • Loading branch information
Gobbel2000 committed Jul 16, 2022
1 parent fc3288b commit 2f783dd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/notation/view/notationviewinputcontroller.cpp
Expand Up @@ -398,6 +398,15 @@ void NotationViewInputController::wheelEvent(QWheelEvent* event)
qreal stepsX = 0.0;
qreal stepsY = 0.0;

// pixelDelta is unreliable on X11
#ifdef Q_OS_LINUX
if (std::getenv("WAYLAND_DISPLAY") == NULL) {
// Ignore pixelsScrolled unless Wayland is used
pixelsScrolled.setX(0);
pixelsScrolled.setY(0);
}
#endif

if (!pixelsScrolled.isNull()) {
dx = pixelsScrolled.x();
dy = pixelsScrolled.y();
Expand Down

0 comments on commit 2f783dd

Please sign in to comment.