diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2023-01-05 03:46:45 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-04-03 21:29:41 +0100 |
commit | e68b57e2e0983d66cdf1d48e9216d32fa1e63f68 (patch) | |
tree | e97a2f6438d913aed7b8fe2442db5700012e2028 /tests/auto/gui/image/qimagereader/tst_qimagereader.cpp | |
parent | e36c1a8d840ee47be0d4fbf8069fda536042a53c (diff) |
Windows: use MSG timestamps for input events
Input events have a timestamp. When dispatching an event through QPA, a
platform plugin can either provide it, or QPA will use an internal
QElapsedTimer to provide a timestamp.
Windows input messages do come with a timestamp already, so we can use
that instead of the QPA.
The two methods are not equivalent.
For instance: for various reasons, Qt does not honor Windows' "double
clicked" message, but uses the delta between two mouse events to
establish if the second click is actually a double click.
Now suppose that the user double clicks on a widget. On the first click,
the application does something that freezes it for a bit (e.g. some
heavy repainting or whatever). Does the second click register as a
double click or not?
* If we're using Qt's own timer, the answer is NO; the event is pulled
from the WM queue after the freeze, given a timestamp far away from
the last click, and so it will be deemed another single click
* If we use the OS' timestamps, then the second click will be seen as
"close" to the first click, and correctly registered as second click.
This reasoning can be extended to many other QPA events, but looks like
the APIs for some are missing (e.g. enter events), so I'm not tackling
them here.
This commit reverts ade96ff6446d4b0977d4e5f03b96b77ff8223b8b.
Task-number: QTBUG-109833
Task-number: QTBUG-122226
Change-Id: I5f3fba029b44c618ef622bacdc4bcc3928e04867
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Diffstat (limited to 'tests/auto/gui/image/qimagereader/tst_qimagereader.cpp')
0 files changed, 0 insertions, 0 deletions