UI: reset interactivity timeout on PC (#23508)

* reset interactive timeout on pc

* cleanup

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
pull/23452/head^2
Dean Lee 3 years ago committed by GitHub
parent a6b46c311e
commit 6dbae9593e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      selfdrive/ui/qt/window.cc

@ -80,19 +80,20 @@ void MainWindow::closeSettings() {
} }
bool MainWindow::eventFilter(QObject *obj, QEvent *event) { bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::TouchBegin) { const QSet<QEvent::Type> evts({QEvent::MouseButtonPress, QEvent::MouseMove,
device.resetInteractiveTimout(); QEvent::TouchBegin, QEvent::TouchUpdate, QEvent::TouchEnd});
}
if (evts.contains(event->type())) {
device.resetInteractiveTimout();
#ifdef QCOM #ifdef QCOM
// filter out touches while in android activity // filter out touches while in android activity
const static QSet<QEvent::Type> filter_events({QEvent::MouseButtonPress, QEvent::MouseMove, QEvent::TouchBegin, QEvent::TouchUpdate, QEvent::TouchEnd});
if (HardwareEon::launched_activity && filter_events.contains(event->type())) {
HardwareEon::check_activity();
if (HardwareEon::launched_activity) { if (HardwareEon::launched_activity) {
return true; HardwareEon::check_activity();
if (HardwareEon::launched_activity) {
return true;
}
} }
}
#endif #endif
}
return false; return false;
} }

Loading…
Cancel
Save