about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorCuriosidad-Racional <hecenra@gmail.com>2020-03-21T12·51+0100
committerGitHub <noreply@github.com>2020-03-21T12·51+0100
commitdc5cc1dead101f7a06e00513fd2a1821ab1f3384 (patch)
tree3c5c47e28a0bed1c986d41176a1f7c0e5b5b7dfd /exwm-input.el
parented0f63327dbfa7ef2ebe1dc37bfc38d40d531c29 (diff)
Fixed fail update when current buffer differs from window
Local variable `exwm--input-mode' from different buffer when current buffer don't contains #id window.

`with-current-buffer' changes buffer after `cl-case' with local `exwm--input-mode'
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el26
1 files changed, 13 insertions, 13 deletions
diff --git a/exwm-input.el b/exwm-input.el
index 82ce82a4e7..2368331cd0 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -749,20 +749,20 @@ button event."
   "Update the propertized `mode-line-process' for window ID."
   (exwm--log "#x%x" id)
   (let (help-echo cmd mode)
-    (cl-case exwm--input-mode
-      (line-mode
-       (setq mode "line"
-             help-echo "mouse-1: Switch to char-mode"
-             cmd (lambda ()
-                   (interactive)
-                   (exwm-input-release-keyboard id))))
-      (char-mode
-       (setq mode "char"
-             help-echo "mouse-1: Switch to line-mode"
-             cmd (lambda ()
-                   (interactive)
-                   (exwm-input-grab-keyboard id)))))
     (with-current-buffer (exwm--id->buffer id)
+      (cl-case exwm--input-mode
+        (line-mode
+         (setq mode "line"
+               help-echo "mouse-1: Switch to char-mode"
+               cmd (lambda ()
+                     (interactive)
+                     (exwm-input-release-keyboard id))))
+        (char-mode
+         (setq mode "char"
+               help-echo "mouse-1: Switch to line-mode"
+               cmd (lambda ()
+                     (interactive)
+                     (exwm-input-grab-keyboard id)))))
       (setq mode-line-process
             `(": "
               (:propertize ,mode