]> Dogcows Code - chaz/openbox/commitdiff
destroy XIC's that belong to an XIM before closing the XIM, else Xlib will seggie!
authorDana Jansens <danakj@orodu.net>
Fri, 12 Feb 2010 13:11:27 +0000 (08:11 -0500)
committerDana Jansens <danakj@orodu.net>
Fri, 12 Feb 2010 14:37:46 +0000 (09:37 -0500)
obt/keyboard.c

index 57208aa2d1c1f9b79f9a70ecf436776d596b110a..f7a0f3bbee80cd83a3c12c336c33b824940fd006 100644 (file)
@@ -116,10 +116,19 @@ void obt_keyboard_reload(void)
 
 void obt_keyboard_shutdown(void)
 {
+    GSList *it;
+
     XFreeModifiermap(modmap);
     modmap = NULL;
     XFree(keymap);
     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);
     xim = NULL;
     xim_style = 0;
@@ -375,11 +384,6 @@ KeySym obt_keyboard_keypress_to_keysym(XEvent *ev)
 
 void obt_keyboard_context_renew(ObtIC *ic)
 {
-    if (ic->xic) {
-        XDestroyIC(ic->xic);
-        ic->xic = NULL;
-    }
-
     if (xim) {
         ic->xic = XCreateIC(xim,
                             XNInputStyle, xim_style,
This page took 0.02312 seconds and 4 git commands to generate.