commit bf3b81e46a8d82091948b519333daa55d1a31897
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Thu Sep 20 23:21:41 2018 +0200

    Ignore horizontal wheel scrolling in workarea
    
    We do not know what to do with horizontal scrolling events, so we ignore 
them.
    
    Note that the code has to be different between Qt4 and Qt5.
    
    Fixes bug #11257.
    
    (cherry picked from commit 2cfbc5ecf6e26da0ca3f61372e5373d1ef4f7ab7)
---
 src/frontends/qt4/GuiWorkArea.cpp |   16 ++++++++++++++++
 status.23x                        |    2 ++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt4/GuiWorkArea.cpp 
b/src/frontends/qt4/GuiWorkArea.cpp
index 4adb155..f20ffe2 100644
--- a/src/frontends/qt4/GuiWorkArea.cpp
+++ b/src/frontends/qt4/GuiWorkArea.cpp
@@ -897,7 +897,23 @@ void GuiWorkArea::wheelEvent(QWheelEvent * ev)
 {
        // Wheel rotation by one notch results in a delta() of 120 (see
        // documentation of QWheelEvent)
+       // But first we have to ignore horizontal scroll events.
+#if QT_VERSION < 0x050000
+       if (ev->orientation() == Qt::Horizontal) {
+               ev->accept();
+               return;
+       }
        double const delta = ev->delta() / 120.0;
+#else
+       QPoint const aDelta = ev->angleDelta();
+       // skip horizontal wheel event
+       if (abs(aDelta.x()) > abs(aDelta.y())) {
+               ev->accept();
+               return;
+       }
+       double const delta = aDelta.y() / 120.0;
+#endif
+
        bool zoom = false;
        switch (lyxrc.scroll_wheel_zoom) {
        case LyXRC::SCROLL_WHEEL_ZOOM_CTRL:
diff --git a/status.23x b/status.23x
index d70960c..65735fe 100644
--- a/status.23x
+++ b/status.23x
@@ -106,6 +106,8 @@ What's new
 
 - Fix conversion of captions from LyX 2.0 documents.
 
+- Ignore horizontal wheel scrolling in work area (bug 11257).
+
 
 
 * USER INTERFACE

Reply via email to