Make sure the emulated mouse event comes last
authorKevin Ottens <kevin.ottens.qnx@kdab.com>
Thu, 12 Jul 2012 09:39:06 +0000 (11:39 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 13 Jul 2012 10:09:42 +0000 (12:09 +0200)
commit2832aaacd4cbdb86271130dbfca284687d641a85
treee5681214c36d2f2a8c0f7f04c3ded92440f0c292
parentdf9e8ab9d6c0da757bad4c1815e9705c92cc5345
Make sure the emulated mouse event comes last

With the recent refactoring in qtdeclarative for the handling of touch
and mouse events, QQuickCanvas automatically transforms touch events in
mouse events too.

It means that since we do something similar in the platform plugin, in
the case of QQuickCanvas the mouse event is duplicated. It it fine
except that having mouse event, touch event, mouse event in that order
is likely to mess the states of some elements. It happens to be the case
for MouseArea which will discard the second mouse event in the case of a
press, and because of that not receive the other events.

By changing the order in the plugin, we ensure getting events in the
following order: touch event, mouse event, mouse event. In the case of
MouseArea, since the press event will be accepted with nothing in
between, we'll keep receiving the other events.

Note that we can't simply remove the mouse event simulation on our side,
otherwise we'd break QWidget support.

Change-Id: If08fe0d97c6d60d0f858b228a014d94bc86dcf6f
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp