Fix Bantam Apps menu entry, st XIM focus, and fcitx5-t9 InputContextDestroyed crash
This commit is contained in:
+25
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user