about summary refs log tree commit diff
path: root/exwm-xim.el
diff options
context:
space:
mode:
Diffstat (limited to 'exwm-xim.el')
-rw-r--r--exwm-xim.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/exwm-xim.el b/exwm-xim.el
index 9589648d22ca..ac530f38930a 100644
--- a/exwm-xim.el
+++ b/exwm-xim.el
@@ -754,10 +754,12 @@ Such event would be received when the client window is destroyed."
   ;; Close IMS communication connections.
   (mapc (lambda (i)
           (when (vectorp i)
-            (xcb:disconnect (elt i 0))))
+            (when (slot-value (elt i 0) 'connected)
+              (xcb:disconnect (elt i 0)))))
         exwm-xim--server-client-plist)
   ;; Close the IMS connection.
-  (unless exwm-xim--conn
+  (unless (and exwm-xim--conn
+               (slot-value exwm-xim--conn 'connected))
     (cl-return-from exwm-xim--exit))
   ;; Remove exwm-xim from XIM_SERVERS.
   (let ((reply (xcb:+request-unchecked+reply exwm-xim--conn