      if (!offroad) {
        closeSettings();
      }
    });
    QObject::connect(&device, &Device::displayPowerChanged, [=]() {
       if(main_layout->currentWidget() != onboardingWindow) {
         closeSettings();
       }
    });
  
    // load fonts
    QFontDatabase::addApplicationFont("../assets/fonts/opensans_regular.ttf");
    QFontDatabase::addApplicationFont("../assets/fonts/opensans_bold.ttf");
 
</s> remove   device.setAwake(true, true);
 </s> add  </s> remove void Device::setAwake(bool on, bool reset) {
 </s> add void Device::setAwake(bool on) { </s> remove   if (reset) {
    awake_timeout = 30 * UI_FREQ;
  }
 </s> add void Device::resetInteractiveTimout() {
  interactive_timeout = (ignition_on ? 10 : 30) * UI_FREQ; </s> remove   // wake screen on tap
 </s> add 
  QObject::connect(&device, &Device::interactiveTimout, [=]() {
    if (main_layout->currentWidget() == settingsWindow) {
      closeSettings();
    }
      if (!offroad) {
        closeSettings();
      }
    });
  QObject::connect(&device, &Device::interactiveTimout, [=]() {
    if (main_layout->currentWidget() == settingsWindow) {
      closeSettings();
    }
  QObject::connect(&device, &Device::interactiveTimout, [=]() {
    if (main_layout->currentWidget() == settingsWindow) {
      closeSettings();
    }
  QObject::connect(&device, &Device::interactiveTimout, [=]() {
    if (main_layout->currentWidget() == settingsWindow) {
      closeSettings();
    }
  QObject::connect(&device, &Device::interactiveTimout, [=]() {
    if (main_layout->currentWidget() == settingsWindow) {
      closeSettings();
    }
    });
  
    // load fonts
    QFontDatabase::addApplicationFont("../assets/fonts/opensans_regular.ttf");
    QFontDatabase::addApplicationFont("../assets/fonts/opensans_bold.ttf");
keep keep keep keep replace replace replace replace keep keep keep keep keep
  UI: add timeout to close settings window while onroad (#22980)

* refactor updateWakefulness

* don't hide sidebar

* rename reset->reset_timeout

* move related variables and functions into class Device

* reset timeout in ctor

* set timeout to 10s if ignition is on

* cleanup

* remove unused QTimer *timer

* check getTimestamp

* keep socket reading in update_state

* keep filtering

Co-authored-by: Willem Melching <willem.melching@gmail.com> 
selfdrive/ui/qt/window.cc