diff --git a/selfdrive/ui/qt/window.cc b/selfdrive/ui/qt/window.cc index 0fee52f736..e2e4fc9082 100644 --- a/selfdrive/ui/qt/window.cc +++ b/selfdrive/ui/qt/window.cc @@ -80,19 +80,20 @@ void MainWindow::closeSettings() { } bool MainWindow::eventFilter(QObject *obj, QEvent *event) { - if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::TouchBegin) { - device.resetInteractiveTimout(); - } + const QSet evts({QEvent::MouseButtonPress, QEvent::MouseMove, + QEvent::TouchBegin, QEvent::TouchUpdate, QEvent::TouchEnd}); + if (evts.contains(event->type())) { + device.resetInteractiveTimout(); #ifdef QCOM - // filter out touches while in android activity - const static QSet filter_events({QEvent::MouseButtonPress, QEvent::MouseMove, QEvent::TouchBegin, QEvent::TouchUpdate, QEvent::TouchEnd}); - if (HardwareEon::launched_activity && filter_events.contains(event->type())) { - HardwareEon::check_activity(); + // filter out touches while in android activity if (HardwareEon::launched_activity) { - return true; + HardwareEon::check_activity(); + if (HardwareEon::launched_activity) { + return true; + } } - } #endif + } return false; }