From 3654c197a9b2de0e92b30a4890abfdefb20c647b Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 26 Jul 2023 12:00:57 +0400 Subject: [PATCH] Fix DirectManipulation scroll events in media viewer. --- .../SourceFiles/media/view/media_view_overlay_widget.cpp | 6 ++++-- Telegram/lib_ui | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 535beeb2a..75faf2be5 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -5065,20 +5065,22 @@ void OverlayWidget::handleKeyPress(not_null e) { void OverlayWidget::handleWheelEvent(not_null e) { constexpr auto step = int(QWheelEvent::DefaultDeltasPerStep); + const auto acceptForJump = (e->source() == Qt::MouseEventNotSynthesized) + || (e->source() == Qt::MouseEventSynthesizedBySystem); _verticalWheelDelta += e->angleDelta().y(); while (qAbs(_verticalWheelDelta) >= step) { if (_verticalWheelDelta < 0) { _verticalWheelDelta += step; if (e->modifiers().testFlag(Qt::ControlModifier)) { zoomOut(); - } else if (e->source() == Qt::MouseEventNotSynthesized) { + } else if (acceptForJump) { moveToNext(1); } } else { _verticalWheelDelta -= step; if (e->modifiers().testFlag(Qt::ControlModifier)) { zoomIn(); - } else if (e->source() == Qt::MouseEventNotSynthesized) { + } else if (acceptForJump) { moveToNext(-1); } } diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 2f0ac3822..91d43ea4b 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 2f0ac382289d0584002c007bdf2b3e4464f75b58 +Subproject commit 91d43ea4b50ef1e7df810ab1f14c49e044570734