[LyX/master] Workaround Qtbug where QAbstractScrollArea::mouseMoveEvent(...) is called falsely when quickly double tapping on a touchpad of a notebook running Windows
Yu Jin
yu_jin at lyx.org
Wed Jul 22 05:37:16 UTC 2020
Am Do., 9. Juli 2020 um 10:18 Uhr schrieb Richard Kimberly Heck <
rikiheck at lyx.org>:
> On 7/9/20 3:53 AM, Yu Jin wrote:
>
> Am Do., 9. Juli 2020 um 09:36 Uhr schrieb Eugene Chornyi <yu_jin at lyx.org>:
>
>> commit 06969f9dd4b9409225e0c8b504395fa197b506d1
>> Author: Eugene Chornyi <yu_jin at lyx.org>
>> Date: Thu Jul 9 09:36:12 2020 +0200
>>
>> Workaround Qtbug where QAbstractScrollArea::mouseMoveEvent(...) is
>> called falsely when quickly double tapping on a touchpad of a notebook
>> running Windows
>> ---
>> src/frontends/qt/GuiWorkArea.cpp | 16 ++++++++++++++++
>> 1 files changed, 16 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/frontends/qt/GuiWorkArea.cpp
>> b/src/frontends/qt/GuiWorkArea.cpp
>> index fa40a5a..23d6efa 100644
>> --- a/src/frontends/qt/GuiWorkArea.cpp
>> +++ b/src/frontends/qt/GuiWorkArea.cpp
>> @@ -852,6 +852,9 @@ void GuiWorkArea::mouseReleaseEvent(QMouseEvent * e)
>>
>> FuncRequest const cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(),
>> q_button_state(e->button()),
>> q_key_state(e->modifiers()));
>> +#if (QT_VERSION > QT_VERSION_CHECK(5,10,1))
>> + d->synthetic_mouse_event_.cmd = cmd; // QtBug
>> QAbstractScrollArea::mouseMoveEvent
>> +#endif
>> d->dispatch(cmd);
>> e->accept();
>> }
>> @@ -859,6 +862,19 @@ void GuiWorkArea::mouseReleaseEvent(QMouseEvent * e)
>>
>> void GuiWorkArea::mouseMoveEvent(QMouseEvent * e)
>> {
>> +#if (QT_VERSION > QT_VERSION_CHECK(5,10,1))
>> + // cancel the event if the coordinates didn't change, this is due
>> to QtBug
>> + // QAbstractScrollArea::mouseMoveEvent, the event is triggered
>> falsely when quickly
>> + // double tapping a touchpad. To test: try to select a word by
>> quickly double tapping
>> + // on a touchpad while hovering the cursor over that word in the
>> work area.
>> + // This bug does not occur on Qt versions 5.10.1 and below. Only
>> Windows seems to be affected.
>> + // ML thread:
>> https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg211699.html
>> + // Qt bugtracker: https://bugreports.qt.io/browse/QTBUG-85431
>> + if (e->x() == d->synthetic_mouse_event_.cmd.x() && // QtBug
>> QAbstractScrollArea::mouseMoveEvent
>> + e->y() == d->synthetic_mouse_event_.cmd.y()) //
>> QtBug QAbstractScrollArea::mouseMoveEvent
>> + return; // QtBug QAbstractScrollArea::mouseMoveEvent
>> +#endif
>> +
>> // we kill the triple click if we move
>> doubleClickTimeout();
>> FuncRequest cmd(LFUN_MOUSE_MOTION, e->x(), e->y(),
>>
>
> Ok to commit to stable?
>
> Let's wait a week or so and see if any problems appear in devel. If not,
> then go ahead.
>
Looks like this Qt bug is fixed for the next Qt 5.15 release (I guess
5.15.1), any idea how to approach this from here?
Eugene
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200722/90cd6d1c/attachment.html>
More information about the lyx-devel
mailing list