st
simple terminal
git clone https://9o.is/git/st.git
commit 338375fbe835c8ee611aec10df4f8d48557341a3 parent 1b9f2b7c3cd0872cabf99ddc3ed70c5fa21d4972 Author: Quentin Rameau <quinq@fifth.space> Date: Sun, 2 Feb 2020 17:38:36 +0100 x: check we still have an XIC context before accessing it Diffstat:
| M | x.c | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/x.c b/x.c @@ -1061,6 +1061,7 @@ void ximdestroy(XIM xim, XPointer client, XPointer call) { xw.ime.xim = NULL; + xw.ime.xic = NULL; XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, ximinstantiate, NULL); XFree(xw.ime.spotlist); @@ -1692,13 +1693,15 @@ focus(XEvent *ev) return; if (ev->type == FocusIn) { - XSetICFocus(xw.ime.xic); + if (xw.ime.xic) + XSetICFocus(xw.ime.xic); win.mode |= MODE_FOCUSED; xseturgency(0); if (IS_SET(MODE_FOCUS)) ttywrite("\033[I", 3, 0); } else { - XUnsetICFocus(xw.ime.xic); + if (xw.ime.xic) + XUnsetICFocus(xw.ime.xic); win.mode &= ~MODE_FOCUSED; if (IS_SET(MODE_FOCUS)) ttywrite("\033[O", 3, 0);