ui/MainWindow: use switch in eventFilter (#28276)

pull/28289/head
Dean Lee 2 years ago committed by GitHub
parent 26064196d0
commit 2c44c8980c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      selfdrive/ui/qt/window.cc

@ -79,11 +79,16 @@ void MainWindow::closeSettings() {
}
bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
const static QSet<QEvent::Type> evts({QEvent::MouseButtonPress, QEvent::MouseMove,
QEvent::TouchBegin, QEvent::TouchUpdate, QEvent::TouchEnd});
if (evts.contains(event->type())) {
switch (event->type()) {
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
case QEvent::MouseButtonPress:
case QEvent::MouseMove:
device.resetInteractiveTimout();
break;
default:
break;
}
return false;
}

Loading…
Cancel
Save