From b52069c4a0bcaafdf0ac3a740eed21d3bc994e35 Mon Sep 17 00:00:00 2001 From: Aristocratos Date: Sat, 14 Dec 2024 12:37:56 +0100 Subject: [PATCH] Fix menu crash when GPU_SUPPORT=false, issue #989 --- src/btop_menu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/btop_menu.cpp b/src/btop_menu.cpp index 488886a5f..d0436211c 100644 --- a/src/btop_menu.cpp +++ b/src/btop_menu.cpp @@ -1327,8 +1327,12 @@ namespace Menu { if (--selected_cat < 0) selected_cat = (int)categories.size() - 1; page = selected = 0; } +#ifdef GPU_SUPPORT else if (is_in(key, "1", "2", "3", "4", "5", "6") or key.starts_with("select_cat_")) { - selected_cat = key.back() - '0' - 1; +#else + else if (is_in(key, "1", "2", "3", "4", "5") or key.starts_with("select_cat_")) { +#endif + selected_cat = key.back() - '0' - 1; page = selected = 0; } else if (is_in(key, "left", "right") or (vim_keys and is_in(key, "h", "l"))) {