summaryrefslogtreecommitdiffstats
path: root/src/gui/platform/unix/qgenericunixservices.cpp
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2025-01-14 16:58:44 +0100
committerIvan Solovev <ivan.solovev@qt.io>2025-01-21 12:29:39 +0100
commitbb716c01118ea42d1d7ffe2ac78501b53f9ed6d1 (patch)
treef1206bde2e7a6ee9dc6d414ce725ad46c9ee2ca3 /src/gui/platform/unix/qgenericunixservices.cpp
parent34f1b6b6d1dd7c37f2d71c0032ddc0c83360c11c (diff)
QEventDispatcherWin32: properly support 64-bit timeouts
The Windows timer APIs take intervals as uint milliseconds. As a result, the code was unconditionally truncating an qint64 millisecond value to uint, leading to incorrect timeouts. Detect such cases, and implement a logic to adjust the interval passed to the Windows APIs and send a timer event at every second timeout. This will give a 1ms or 2ms error in the timeout calculation, but that should be an acceptable tolerance when we talk about intervals around 50 days or longer. Adjust the tst_QChronoTimer::remainingTimeInitial() test to check that the remaining time is not less than "expected interval - 1 minute". This should allow to catch cases when internal calculations are terribly broken. It's not really possible to provide even a manual test for timeouts that are larger than std::numeric_limits<uint>::max(), so just rely on the existing tests to make sure that the updated implementation does not break regular cases with smaller timeouts. Amends 0d0b346322f6b078e6fe60cd3612e8d08a0d5f00. Task-number: QTBUG-129170 Change-Id: Ib9885dcb7aca18e9fb193fad14bace0efeb437da Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/platform/unix/qgenericunixservices.cpp')
0 files changed, 0 insertions, 0 deletions