diff --git a/openpilot/selfdrive/ui/mici/layouts/home.py b/openpilot/selfdrive/ui/mici/layouts/home.py index ee6d839b19..5b1ca0c59c 100644 --- a/openpilot/selfdrive/ui/mici/layouts/home.py +++ b/openpilot/selfdrive/ui/mici/layouts/home.py @@ -190,10 +190,8 @@ class MiciHomeLayout(Widget): def _handle_mouse_release(self, mouse_pos: MousePos): if not self._did_long_press: - relative_x = mouse_pos.x - self.rect.x - has_alerts = self._alert_count_callback and self._alert_count_callback() > 0 - if has_alerts and relative_x > self.rect.width - ALERTS_ZONE_WIDTH: - if self._on_alerts_click: + if mouse_pos.x - self.rect.x > self.rect.width - ALERTS_ZONE_WIDTH: + if self._on_alerts_click and self._alert_count_callback and self._alert_count_callback() > 0: self._on_alerts_click() elif self._on_settings_click: self._on_settings_click()