From 46384f94d368de6b867093fecefe43a78f8cc9d1 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Fri, 22 Mar 2024 01:58:48 +0800 Subject: [PATCH] ui.py: quit if the "X"(exit) button is clicked (#31949) old-commit-hash: 028f6938b2e28d79054e9c11f1b95eba150bfcad --- tools/replay/ui.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/replay/ui.py b/tools/replay/ui.py index aa03ae193c..31e4fff74d 100755 --- a/tools/replay/ui.py +++ b/tools/replay/ui.py @@ -101,8 +101,11 @@ def ui_thread(addr): draw_plots = init_plots(plot_arr, name_to_arr_idx, plot_xlims, plot_ylims, plot_names, plot_colors, plot_styles) vipc_client = VisionIpcClient("camerad", VisionStreamType.VISION_STREAM_ROAD, True) - while 1: - list(pygame.event.get()) + while True: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit() + sys.exit() screen.fill((64, 64, 64)) lid_overlay = lid_overlay_blank.copy()