Fix Bantam Apps menu entry, st XIM focus, and fcitx5-t9 InputContextDestroyed crash
This commit is contained in:
@@ -36,15 +36,15 @@ export QT_IM_MODULE=fcitx
|
|||||||
export XMODIFIERS=@im=fcitx
|
export XMODIFIERS=@im=fcitx
|
||||||
|
|
||||||
if [ -d /home/user/.local/x11 ]; then
|
if [ -d /home/user/.local/x11 ]; then
|
||||||
export FCITX_ADDON_DIRS=/home/user/.local/x11:/usr/lib/fcitx5
|
export FCITX_ADDON_DIRS=/home/user/.local/lib/fcitx5:/home/user/.local/x11:/usr/lib/fcitx5
|
||||||
export LD_LIBRARY_PATH=/tmp/x11/usr/lib:/usr/lib:/lib
|
export LD_LIBRARY_PATH=/tmp/x11/usr/lib:/usr/lib:/lib
|
||||||
export PATH=/home/user/.config/sxmo/hooks:/home/user/.local/bin:/tmp/x11/usr/bin:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
|
export PATH=/home/user/.local/bin:/home/user/.config/sxmo/hooks:/tmp/x11/usr/bin:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
|
||||||
rm -rf /tmp/x11
|
rm -rf /tmp/x11
|
||||||
ln -s /home/user/.local/x11 /tmp/x11
|
ln -s /home/user/.local/x11 /tmp/x11
|
||||||
cp -f /home/user/.local/x11/xorg-bananarchy.conf /tmp/xorg-bananarchy.conf 2>/dev/null || true
|
cp -f /home/user/.local/x11/xorg-bananarchy.conf /tmp/xorg-bananarchy.conf 2>/dev/null || true
|
||||||
else
|
else
|
||||||
export FCITX_ADDON_DIRS=/usr/lib/fcitx5
|
export FCITX_ADDON_DIRS=/home/user/.local/lib/fcitx5:/usr/lib/fcitx5
|
||||||
export PATH=/home/user/.config/sxmo/hooks:/home/user/.local/bin:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
|
export PATH=/home/user/.local/bin:/home/user/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
|
||||||
cp -f /etc/X11/xorg.conf.d/10-bananarchy-msm8909.conf /tmp/xorg-bananarchy.conf 2>/dev/null || true
|
cp -f /etc/X11/xorg.conf.d/10-bananarchy-msm8909.conf /tmp/xorg-bananarchy.conf 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,10 +6,11 @@
|
|||||||
|
|
||||||
# include common definitions \
|
# include common definitions \
|
||||||
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
|
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
|
||||||
|
export PATH="${HOME:-/home/user}/.local/bin:${HOME:-/home/user}/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:$PATH"
|
||||||
. sxmo_hook_icons.sh
|
. sxmo_hook_icons.sh
|
||||||
|
|
||||||
APPS_CACHE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_apps.cache"
|
APPS_CACHE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_apps.cache"
|
||||||
if [ -f "$APPS_CACHE" ] && [ ! "$0" -nt "$APPS_CACHE" ] && [ ! /usr/bin -nt "$APPS_CACHE" ] && [ ! /usr/local/bin -nt "$APPS_CACHE" ]; then
|
if [ -f "$APPS_CACHE" ] && [ ! "$0" -nt "$APPS_CACHE" ] && [ ! /usr/bin -nt "$APPS_CACHE" ] && [ ! /usr/local/bin -nt "$APPS_CACHE" ] && [ ! "${HOME:-/home/user}/.local/bin" -nt "$APPS_CACHE" ]; then
|
||||||
cat "$APPS_CACHE"
|
cat "$APPS_CACHE"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -48,7 +49,7 @@ write_line_app bantam "$icon_trm Bantam" 'cd "$HOME" && sxmo_terminal.sh bantam'
|
|||||||
write_line_app baobab "$icon_pie Baobab" "baobab"
|
write_line_app baobab "$icon_pie Baobab" "baobab"
|
||||||
write_line_app bluetuith "$icon_bth Bluetuith" "sxmo_terminal.sh bluetuith"
|
write_line_app bluetuith "$icon_bth Bluetuith" "sxmo_terminal.sh bluetuith"
|
||||||
write_line_app calcurse "$icon_clk Calcurse" "sxmo_terminal.sh calcurse"
|
write_line_app calcurse "$icon_clk Calcurse" "sxmo_terminal.sh calcurse"
|
||||||
write_line_app bananarchy-photo "$icon_cam Camera" "bananarchy-photo --menu"
|
write_line_app xcamera "$icon_cam Camera" "xcamera"
|
||||||
write_line_app celluloid "$icon_mvi Celluloid" "celluloid"
|
write_line_app celluloid "$icon_mvi Celluloid" "celluloid"
|
||||||
write_line_app chatty "$icon_msg Chatty" "chatty"
|
write_line_app chatty "$icon_msg Chatty" "chatty"
|
||||||
([ -z "$WAYLAND_DISPLAY" ] && command -v clipmenu >/dev/null) && \
|
([ -z "$WAYLAND_DISPLAY" ] && command -v clipmenu >/dev/null) && \
|
||||||
@@ -203,7 +204,7 @@ write_line_app siglo "$icon_clk Siglo" "siglo"
|
|||||||
write_line_app simple-scan "$icon_scn Simple Scan" "simple-scan"
|
write_line_app simple-scan "$icon_scn Simple Scan" "simple-scan"
|
||||||
write_line_app snapshot "$icon_cam Snapshot" "snapshot"
|
write_line_app snapshot "$icon_cam Snapshot" "snapshot"
|
||||||
write_line_app solanum "$icon_pom Solanum" "solanum"
|
write_line_app solanum "$icon_pom Solanum" "solanum"
|
||||||
write_line_app st "$icon_trm St" "st -e ${SHELL:-/bin/sh}"
|
write_line_app st "$icon_trm Terminal" "st -e ${SHELL:-/bin/sh}"
|
||||||
write_line_app supertuxkart "$icon_krt SuperTuxKart" "supertuxkart"
|
write_line_app supertuxkart "$icon_krt SuperTuxKart" "supertuxkart"
|
||||||
write_line_app surf "$icon_glb Surf" "surf"
|
write_line_app surf "$icon_glb Surf" "surf"
|
||||||
write_line_app syncthing "$icon_rld Syncthing" "syncthing"
|
write_line_app syncthing "$icon_rld Syncthing" "syncthing"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -267,11 +267,10 @@ T9Engine::T9Engine(fcitx::Instance* instance)
|
|||||||
fcitx::EventType::InputContextDestroyed,
|
fcitx::EventType::InputContextDestroyed,
|
||||||
fcitx::EventWatcherPhase::PreInputMethod,
|
fcitx::EventWatcherPhase::PreInputMethod,
|
||||||
[this](fcitx::Event& event) {
|
[this](fcitx::Event& event) {
|
||||||
auto& icEvent = static_cast<fcitx::InputContextEvent&>(event);
|
FCITX_UNUSED(event);
|
||||||
if (auto* ic = icEvent.inputContext()) {
|
if (sharedMode == T9Mode::Ctrl) {
|
||||||
if (auto* state = ic->propertyFor(&factory)) {
|
sharedMode = T9Mode::Lower;
|
||||||
state->onFocusChange();
|
writeStatusIndicator("[abc]");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
writeStatusIndicator("[abc]");
|
writeStatusIndicator("[abc]");
|
||||||
@@ -938,9 +937,14 @@ void T9State::cancelCommit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void T9State::resetUI() {
|
void T9State::resetUI() {
|
||||||
|
if (!ic) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ic->inputPanel().reset();
|
ic->inputPanel().reset();
|
||||||
ic->updatePreedit();
|
if (ic->hasFocus()) {
|
||||||
ic->updateUserInterface(fcitx::UserInterfaceComponent::InputPanel);
|
ic->updatePreedit();
|
||||||
|
ic->updateUserInterface(fcitx::UserInterfaceComponent::InputPanel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void T9State::showStatusBanner(const std::string& msg) {
|
void T9State::showStatusBanner(const std::string& msg) {
|
||||||
|
|||||||
+25
-2
@@ -1558,6 +1558,14 @@ add_parsed_choice_line(const char *line)
|
|||||||
trim_inplace(cmd);
|
trim_inplace(cmd);
|
||||||
if (!label[0] || !cmd[0])
|
if (!label[0] || !cmd[0])
|
||||||
return;
|
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;
|
int loop = (strchr(loop_str, '1') != NULL) ? 1 : 0;
|
||||||
if (strncmp(cmd, "sxmo_appmenu.sh ", 16) == 0) {
|
if (strncmp(cmd, "sxmo_appmenu.sh ", 16) == 0) {
|
||||||
const char *sub = cmd + 16;
|
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) {
|
} else if (strcmp(menu_name, "applications") == 0) {
|
||||||
reset_session_defaults(1, "Apps");
|
reset_session_defaults(1, "Apps");
|
||||||
append_active_call_entries();
|
append_active_call_entries();
|
||||||
snprintf(label, sizeof(label), "%s Themes", ICON_THM);
|
const char *home = getenv("HOME");
|
||||||
add_menu_item(label, "@plugin:themes", 0);
|
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");
|
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);
|
snprintf(label, sizeof(label), "%s System Menu", ICON_MNU);
|
||||||
add_menu_item(label, "@menu:sys", 1);
|
add_menu_item(label, "@menu:sys", 1);
|
||||||
snprintf(label, sizeof(label), "%s Close Menu", ICON_CLS);
|
snprintf(label, sizeof(label), "%s Close Menu", ICON_CLS);
|
||||||
|
|||||||
@@ -1118,11 +1118,14 @@ ximopen(Display *dpy)
|
|||||||
xw.ime.xic = XCreateIC(xw.ime.xim, XNInputStyle,
|
xw.ime.xic = XCreateIC(xw.ime.xim, XNInputStyle,
|
||||||
XIMPreeditNothing | XIMStatusNothing,
|
XIMPreeditNothing | XIMStatusNothing,
|
||||||
XNClientWindow, xw.win,
|
XNClientWindow, xw.win,
|
||||||
|
XNFocusWindow, xw.win,
|
||||||
XNDestroyCallback, &icdestroy,
|
XNDestroyCallback, &icdestroy,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
if (xw.ime.xic == NULL)
|
if (xw.ime.xic == NULL)
|
||||||
fprintf(stderr, "XCreateIC: Could not create input context.\n");
|
fprintf(stderr, "XCreateIC: Could not create input context.\n");
|
||||||
|
else if (win.mode & MODE_FOCUSED)
|
||||||
|
XSetICFocus(xw.ime.xic);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -1981,6 +1984,8 @@ run(void)
|
|||||||
if (ev.type == ConfigureNotify) {
|
if (ev.type == ConfigureNotify) {
|
||||||
w = ev.xconfigure.width;
|
w = ev.xconfigure.width;
|
||||||
h = ev.xconfigure.height;
|
h = ev.xconfigure.height;
|
||||||
|
} else if (ev.type == FocusIn || ev.type == FocusOut) {
|
||||||
|
focus(&ev);
|
||||||
}
|
}
|
||||||
} while (ev.type != MapNotify);
|
} while (ev.type != MapNotify);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user