Commit d074b47a authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Fix logical error

It makes more sense to access position() if positionValid() returns true.
parent 3e739ff8
......@@ -2787,7 +2787,7 @@ void InputDeviceHandler::update()
Toplevel *toplevel = nullptr;
QWindow *internalWindow = nullptr;
if (!positionValid()) {
if (positionValid()) {
const auto pos = position().toPoint();
internalWindow = findInternalWindow(pos);
if (internalWindow) {
......
......@@ -478,7 +478,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