From 2f71d9d837ad50428dc86ca80496b16b8140b2bf Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 5 Nov 2020 10:08:49 +0100 Subject: [PATCH] Silence "same window" warning when QPA doesn't give touch dest window Platform plugins should dispatch events to specific windows when possible; but eglfs currently doesn't do that, so this warning was printing for many touch events. Now we print it only if the window that the platform plugin says *should* handle a touch move or release is non-null and *different* than the one that actually handled the press. Fixes: QTBUG-88192 Change-Id: Ia3271b5e67902dcf8a1cdae605adec470c3cfd89 Reviewed-by: Samuli Piippo --- src/gui/kernel/qguiapplication.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index a57b34a3d98..f7e07092ddc 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2879,17 +2879,15 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To break; case QEventPoint::State::Released: - if (Q_UNLIKELY(window != mut.window())) { + if (Q_UNLIKELY(!window.isNull() && window != mut.window())) qCWarning(lcPtrDispatch) << "delivering touch release to same window" << mut.window() << "not" << window.data(); - window = mut.window(); - } + window = mut.window(); break; default: // update or stationary - if (Q_UNLIKELY(window != mut.window())) { + if (Q_UNLIKELY(!window.isNull() && window != mut.window())) qCWarning(lcPtrDispatch) << "delivering touch update to same window" << mut.window() << "not" << window.data(); - window = mut.window(); - } + window = mut.window(); break; } // If we somehow still don't have a window, we can't deliver this touchpoint. (should never happen)