From f82e1d42b9a6ea12cc3e2c0876797bf067a587fe Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 15 Nov 2021 16:27:19 -0800 Subject: [PATCH] UI: fix alert flicker when controlsState not updated (#22921) old-commit-hash: 2f90f04f8d1a64c22f4162e9425e80645bd28092 --- selfdrive/ui/qt/onroad.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index a2195a621d..c3fbdcb6e6 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -42,10 +42,12 @@ OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { void OnroadWindow::updateState(const UIState &s) { QColor bgColor = bg_colors[s.status]; Alert alert = Alert::get(*(s.sm), s.scene.started_frame); + if (s.sm->updated("controlsState") || !alert.equal({})) { + alerts->updateAlert(alert, bgColor); + } if (alert.type == "controlsUnresponsive") { bgColor = bg_colors[STATUS_ALERT]; } - alerts->updateAlert(alert, bgColor); if (bg != bgColor) { // repaint border bg = bgColor;