Skip to content

Commit

Permalink
UI: reset interactivity timeout on PC (commaai#23508)
Browse files Browse the repository at this point in the history
* reset interactive timeout on pc

* cleanup

Co-authored-by: Adeeb Shihadeh <[email protected]>
  • Loading branch information
deanlee and adeebshihadeh authored Jan 14, 2022
1 parent a6b46c3 commit 6dbae95
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions selfdrive/ui/qt/window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<QEvent::Type> 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<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();
// 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;
}

0 comments on commit 6dbae95

Please sign in to comment.