diff options
author | Tor Arne Vestbø <[email protected]> | 2025-03-28 14:22:19 +0100 |
---|---|---|
committer | Tor Arne Vestbø <[email protected]> | 2025-03-31 23:15:45 +0200 |
commit | 4ae41c225be57492d5bf0e50c58bf18091414c47 (patch) | |
tree | 26454f995f307c9a8d0648d7f516c7e21f13c99c /src/gui/kernel/qsimpledrag.cpp | |
parent | 4afd089612448ae13136e287ced134c71499cfec (diff) |
Use QLastCursorPosition to check for missing cursor position
After c5792dcfd631abb4f9e2b92cd6e88d7e5c373406 the last cursor position
is reflected as a QPoint(std::numeric_limits<int>::max(), ...), and
after 209a2145f94e99f99832c3a08cdf579d8f42ca55 as 1 << 23. Instead of
hard coding the sentinel value, let's use QLastCursorPosition directly.
Pick-to: 6.9 6.8 6.5
Change-Id: I24031f3cc800d2f0028eb95f4f8597019cc945c0
Reviewed-by: Shawn Rutledge <[email protected]>
Diffstat (limited to 'src/gui/kernel/qsimpledrag.cpp')
-rw-r--r-- | src/gui/kernel/qsimpledrag.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp index bff1ad482bd..2ca2eca15be 100644 --- a/src/gui/kernel/qsimpledrag.cpp +++ b/src/gui/kernel/qsimpledrag.cpp @@ -195,7 +195,8 @@ void QBasicDrag::startDrag() QPoint pos; #ifndef QT_NO_CURSOR pos = QCursor::pos(); - if (pos.x() == int(qInf())) { + static constexpr QGuiApplicationPrivate::QLastCursorPosition uninitializedCursorPosition; + if (pos == uninitializedCursorPosition) { // ### fixme: no mouse pos registered. Get pos from touch... pos = QPoint(); } |