Warning, /graphics/krita/3rdparty/ext_qt/0001-QMenu-make-less-sensitive-to-mouse-jitter.patch is written in an unsupported language. File is not indexed.
0001 From 6961d658a0455406ea6d9d2ab9042b59579f8382 Mon Sep 17 00:00:00 2001 0002 From: Volker Hilsheimer <volker.hilsheimer@qt.io> 0003 Date: Wed, 19 Aug 2020 12:38:20 +0200 0004 Subject: [PATCH] QMenu: make less sensitive to mouse jitter 0005 0006 On systems where a right-press brings up the menu, the next mouse 0007 move will select an action, even if it's just a move by a single pixel. 0008 This makes it too easy to activate an action on e.g a context menu 0009 accidentially when the button is released. 0010 0011 Ignore the first couple of mouse moves, using the same logic that 0012 prevents accidental tearing off. 0013 0014 Change-Id: Ib4dd448ef2d6ae915b48da62666aa95b37145d63 0015 Fixes: QTBUG-57849 0016 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> 0017 --- 0018 src/widgets/widgets/qmenu.cpp | 6 ++---- 0019 1 file changed, 2 insertions(+), 4 deletions(-) 0020 0021 diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp 0022 index 6e6825daea..365aabd92f 100644 0023 --- a/src/widgets/widgets/qmenu.cpp 0024 +++ b/src/widgets/widgets/qmenu.cpp 0025 @@ -1510,9 +1510,7 @@ bool QMenuPrivate::hasMouseMoved(const QPoint &globalPos) 0026 { 0027 //determines if the mouse has moved (ie its initial position has 0028 //changed by more than QApplication::startDragDistance() 0029 - //or if there were at least 6 mouse motions) 0030 - return motions > 6 || 0031 - QApplication::startDragDistance() < (mousePopupPos - globalPos).manhattanLength(); 0032 + return QApplication::startDragDistance() < (mousePopupPos - globalPos).manhattanLength(); 0033 } 0034 0035 0036 @@ -3456,7 +3454,7 @@ void QMenu::mouseMoveEvent(QMouseEvent *e) 0037 return; 0038 0039 d->motions++; 0040 - if (d->motions == 0) 0041 + if (!d->hasMouseMoved(e->globalPos())) 0042 return; 0043 0044 d->hasHadMouse = d->hasHadMouse || rect().contains(e->pos()); 0045 -- 0046 2.35.1 0047