Skip to content

Commit

Permalink
Fix menu crash when GPU_SUPPORT=false, issue #989
Browse files Browse the repository at this point in the history
  • Loading branch information
aristocratos committed Dec 14, 2024
1 parent e17bc6b commit b52069c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/btop_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))) {
Expand Down

0 comments on commit b52069c

Please sign in to comment.