[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/xelb 23cb30b 12/42: Fix an emacsclient bug

From: Chris Feng
Subject: [elpa] externals/xelb 23cb30b 12/42: Fix an emacsclient bug
Date: Thu, 17 Sep 2015 23:16:41 +0000

branch: externals/xelb
commit 23cb30b3d948f09de2ec0fe351e37463f3b190b7
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Fix an emacsclient bug
    When calling `xcb:keysyms:update-modifier-mapping` from a terminal
    (e.g. created by `emacsclient -t`), the selected frame cannot be used to
    receive X events.
 xcb-keysyms.el |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xcb-keysyms.el b/xcb-keysyms.el
index 87c8247..d64abe5 100644
--- a/xcb-keysyms.el
+++ b/xcb-keysyms.el
@@ -112,7 +112,12 @@ This method must be called before using any other method 
in this module."
             ((memq 'kp-numlock events)
              (setq xcb:keysyms:num-lock-mask (elt mode-masks i))))))
   ;; Determine remaining keys
-  (let* ((id (string-to-int (frame-parameter nil 'window-id)))
+  (let* ((frame (unless (frame-parameter nil 'window-id)
+                  (catch 'break
+                    (dolist (i (frame-list))
+                      (when (frame-parameter i 'window-id)
+                        (throw 'break i))))))
+         (id (string-to-int (frame-parameter frame 'window-id)))
           (slot-value (car (slot-value (xcb:get-setup obj) 'roots)) 'root))
          (keycode (xcb:keysyms:keysym->keycode obj ?a))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]