From 436efa2df8e50f2cffb8a2f9a69fc705134d6bba Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Mon, 16 Mar 2020 12:17:06 +1000 Subject: [PATCH] do not allow sidebar while in waze mode. --- selfdrive/ui/ui.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 3c0a7c50d..79b51be0a 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -983,13 +983,18 @@ int main(int argc, char* argv[]) { s->scene.ui_viz_rw = hasSidebar ? box_w : (box_w + sbr_w - (bdr_s * 2)); s->scene.ui_viz_ro = hasSidebar ? -(sbr_w - 6 * bdr_s) : 0; - // poll for touch events - int touch_x = -1, touch_y = -1; - int touched = touch_poll(&touch, &touch_x, &touch_y, 0); - if (touched == 1) { - set_awake(s, true); - handle_sidebar_touch(s, touch_x, touch_y); - handle_vision_touch(s, touch_x, touch_y); + if (s->vision_connected && s->dragon_waze_mode) { + // always collapsed sidebar when vision is connect and in waze mode + s->scene.uilayout_sidebarcollapsed = true; + } else { + // poll for touch events + int touch_x = -1, touch_y = -1; + int touched = touch_poll(&touch, &touch_x, &touch_y, 0); + if (touched == 1) { + set_awake(s, true); + handle_sidebar_touch(s, touch_x, touch_y); + handle_vision_touch(s, touch_x, touch_y); + } } if (!s->vision_connected) {