mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 10:55:37 +00:00
Fix regression in Ctrl+Wheel zoom when using the touchpad
For some reason Qt started sending mouse move events after all wheel events so only reset the delta when the mouse move event represents an actual move
This commit is contained in:
parent
22c5ceae7f
commit
ba1c2beb70
|
@ -145,6 +145,7 @@ public:
|
|||
QPoint mouseGrabPos;
|
||||
QPoint mousePressPos;
|
||||
QPoint mouseSelectPos;
|
||||
QPoint previousMouseMovePos;
|
||||
int mouseMidLastY;
|
||||
bool mouseSelecting;
|
||||
QRect mouseSelectionRect;
|
||||
|
@ -2070,7 +2071,14 @@ void PageView::tabletEvent( QTabletEvent * e )
|
|||
|
||||
void PageView::mouseMoveEvent( QMouseEvent * e )
|
||||
{
|
||||
d->controlWheelAccumulatedDelta = 0;
|
||||
// For some reason in Qt 5.11.2 (no idea when this started) all wheel
|
||||
// events are followed by mouse move events (without changing position),
|
||||
// so we only actually reset the controlWheelAccumulatedDelta if there is a mouse movement
|
||||
if ( e->globalPos() != d->previousMouseMovePos )
|
||||
{
|
||||
d->controlWheelAccumulatedDelta = 0;
|
||||
}
|
||||
d->previousMouseMovePos = e->globalPos();
|
||||
|
||||
// don't perform any mouse action when no document is shown
|
||||
if ( d->items.isEmpty() )
|
||||
|
|
Loading…
Reference in a new issue