[Development] Question regarding recent commit 'Fix double click handling.'

laszlo.p.agocs at nokia.com laszlo.p.agocs at nokia.com
Fri Mar 9 10:16:03 CET 2012


Hi Jon,

Yes, good catch, the built-in timestamping of QWindowSystemInterface is broken due to the lack of a call to start() or restart(). This affects mouse and touch events generated by plugins that do not provide their own timestamps. 

The patch looks good although we may want to consider switching to QElapsedTimer. But that's something for another patch.
 
Regards,
Laszlo

-----Original Message-----
From: development-bounces+laszlo.p.agocs=nokia.com at qt-project.org [mailto:development-bounces+laszlo.p.agocs=nokia.com at qt-project.org] On Behalf Of ext Jon Trulson
Sent: 09 March 2012 01:19
To: development at qt-project.org
Subject: [Development] Question regarding recent commit 'Fix double click handling.'

regarding commit id: b371f3f943703840d0dfbe30505018bcca06e260

I guess this question is for you Laszlo.

About a week or so ago, I discovered a problem with mouse handling (arm board, eglfs, using evdevmouse plugin).

I found that every other mouse press event (with no intervening
movement) would get lost.

Digging deeper, I found that the event timer
(QWindowSystemInterfacePrivate::eventTime) in qwindowsysteminterface_qpa.cpp is never actually .start()'ed.  This results in all eventTime.elapsed() calls returning 0, and therefore any comparisons against the event's timestamp in other places (like the doubleclick logic) to be meaningless (since they are all always 0).

I submitted a change request: http://codereview.qt-project.org/18482
that did fix the missing button event problem, by ensuring that the timer is actually started. I didn't know who to ask to review, but maybe you are the one?

At any rate, with your fixes (the above mentioned commit) and my fix removed as a test, I no longer miss mouse button events.  However, every other click now generates a doubleclick event, which is wrong.

Re-adding my fix seems to work correctly - I only get doubleclicks events when I actually doubleclick.

So - while my fix may not be the best place to start the timer, it is still needed in some fashion - the timer has to be started somewhere for this logic to ever work properly...

Can this change request get reviewed or laughed at?

Thanks.

--
Jon Trulson

"Get the cheese to sickbay, the Doctor should look at it as soon as
  possible." -- Chief Engineer B'Elanna Torres, Voyager _______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list