destroy XIC's that belong to an XIM before closing the XIM, else Xlib will seggie!
This commit is contained in:
parent
aa5394cad2
commit
7c2eb3a781
1 changed files with 9 additions and 5 deletions
|
@ -116,10 +116,19 @@ void obt_keyboard_reload(void)
|
||||||
|
|
||||||
void obt_keyboard_shutdown(void)
|
void obt_keyboard_shutdown(void)
|
||||||
{
|
{
|
||||||
|
GSList *it;
|
||||||
|
|
||||||
XFreeModifiermap(modmap);
|
XFreeModifiermap(modmap);
|
||||||
modmap = NULL;
|
modmap = NULL;
|
||||||
XFree(keymap);
|
XFree(keymap);
|
||||||
keymap = NULL;
|
keymap = NULL;
|
||||||
|
for (it = xic_all; it; it = g_slist_next(it)) {
|
||||||
|
ObtIC* ic = it->data;
|
||||||
|
if (ic->xic) {
|
||||||
|
XDestroyIC(ic->xic);
|
||||||
|
ic->xic = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (xim) XCloseIM(xim);
|
if (xim) XCloseIM(xim);
|
||||||
xim = NULL;
|
xim = NULL;
|
||||||
xim_style = 0;
|
xim_style = 0;
|
||||||
|
@ -375,11 +384,6 @@ KeySym obt_keyboard_keypress_to_keysym(XEvent *ev)
|
||||||
|
|
||||||
void obt_keyboard_context_renew(ObtIC *ic)
|
void obt_keyboard_context_renew(ObtIC *ic)
|
||||||
{
|
{
|
||||||
if (ic->xic) {
|
|
||||||
XDestroyIC(ic->xic);
|
|
||||||
ic->xic = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xim) {
|
if (xim) {
|
||||||
ic->xic = XCreateIC(xim,
|
ic->xic = XCreateIC(xim,
|
||||||
XNInputStyle, xim_style,
|
XNInputStyle, xim_style,
|
||||||
|
|
Loading…
Reference in a new issue