mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-27 06:13:55 +08:00
UI: reset interactivity timeout on PC (#23508)
* reset interactive timeout on pc * cleanup Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user