Commit 70d3a4d2 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Fix logical error

It makes more sense to access position() if positionValid() returns true.


(cherry picked from commit d074b47a)
parent 571e2c4e
......@@ -2788,7 +2788,7 @@ void InputDeviceHandler::update()
Toplevel *toplevel = nullptr;
QWindow *internalWindow = nullptr;
if (!positionValid()) {
if (positionValid()) {
const auto pos = position().toPoint();
internalWindow = findInternalWindow(pos);
if (internalWindow) {
......
......@@ -482,7 +482,7 @@ protected:
* is resting on the surface (no touch point).
*/
virtual bool positionValid() const {
return false;
return true;
}
virtual bool focusUpdatesBlocked() {
return false;
......
......@@ -77,7 +77,7 @@ bool TouchInputRedirection::positionValid() const
{
Q_ASSERT(m_touches >= 0);
// we can only determine a position with at least one touch point
return m_touches == 0;
return m_touches;
}
void TouchInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment