Fix Bantam Apps menu entry, st XIM focus, and fcitx5-t9 InputContextDestroyed crash

This commit is contained in:
Luxferre
2026-10-22 16:10:56 +03:00
parent 6e58218e10
commit 4e503d0654
13 changed files with 49 additions and 16 deletions
+25 -2
View File
@@ -1558,6 +1558,14 @@ add_parsed_choice_line(const char *line)
trim_inplace(cmd);
if (!label[0] || !cmd[0])
return;
for (size_t i = 0; i < items_count; i++) {
if (items[i].text && strcmp(items[i].text, label) == 0)
return;
if (items[i].text && strstr(label, "Themes") && strstr(items[i].text, "Themes"))
return;
if (items[i].text && strstr(label, "Bantam") && strstr(items[i].text, "Bantam"))
return;
}
int loop = (strchr(loop_str, '1') != NULL) ? 1 : 0;
if (strncmp(cmd, "sxmo_appmenu.sh ", 16) == 0) {
const char *sub = cmd + 16;
@@ -1751,9 +1759,24 @@ open_builtin_menu(const char *menu_name, int keep_idx)
} else if (strcmp(menu_name, "applications") == 0) {
reset_session_defaults(1, "Apps");
append_active_call_entries();
snprintf(label, sizeof(label), "%s Themes", ICON_THM);
add_menu_item(label, "@plugin:themes", 0);
const char *home = getenv("HOME");
char bpath[256];
snprintf(bpath, sizeof(bpath), "%s/.local/bin/bantam", (home && home[0]) ? home : "/home/user");
if (access("/usr/bin/bantam", X_OK) == 0 || access("/usr/local/bin/bantam", X_OK) == 0 || access(bpath, X_OK) == 0) {
snprintf(label, sizeof(label), "%s Bantam", ICON_TRM);
add_menu_item(label, "cd \"$HOME\" && sxmo_terminal.sh bantam", 0);
}
load_cache_or_hook("sxmo_apps.cache", "sxmo_hook_apps.sh");
snprintf(label, sizeof(label), "%s Themes", ICON_THM);
int has_themes = 0;
for (size_t i = 0; i < items_count; i++) {
if (items[i].text && strstr(items[i].text, "Themes")) {
has_themes = 1;
break;
}
}
if (!has_themes)
add_menu_item(label, "@plugin:themes", 0);
snprintf(label, sizeof(label), "%s System Menu", ICON_MNU);
add_menu_item(label, "@menu:sys", 1);
snprintf(label, sizeof(label), "%s Close Menu", ICON_CLS);