about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2017-11-05T14·31+0800
committerChris Feng <chris.w.feng@gmail.com>2017-11-05T14·34+0800
commitdea874e240896762183e90d9aecb38ff95bbc62f (patch)
tree1716224f2cfcde51b46eb77e8c0d83be25a461f7
parent3edf2e8880aff11803f4d4889914e05c3543e6e7 (diff)
Filter out events relating to temp buffers
* exwm-input.el (exwm-input--on-buffer-list-update): Filter out events
relating to temp buffers by detecting if temp-buffer is present.
-rw-r--r--exwm-input.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/exwm-input.el b/exwm-input.el
index d14b0b52d5ec..bee2ac6450d5 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -153,9 +153,12 @@ This value should always be overwritten.")
 
 (defun exwm-input--on-buffer-list-update ()
   "Run in `buffer-list-update-hook' to track input focus."
-  (when (and (eq (current-buffer) (window-buffer)) ;e.g. `with-temp-buffer'.
-             (not (eq this-command #'handle-switch-frame))
-             (not (exwm-workspace--client-p)))
+  (when (and (not (eq this-command #'handle-switch-frame))
+             (not (exwm-workspace--client-p))
+             ;; The following conditions filter out events relating to temp
+             ;; buffers.
+             (eq (current-buffer) (window-buffer))
+             (not (get-buffer " *temp*")))
     (setq exwm-input--update-focus-window (selected-window))
     (exwm-input--update-focus-defer)))