about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2018-12-16T00·00+0000
committerChris Feng <chris.w.feng@gmail.com>2018-12-16T00·00+0000
commit2efd7495d9755e12a611dbf27dac6057287cd590 (patch)
treebbff92c47bc9d25ac71b943a6d065ab07b1ce9de /exwm-input.el
parente6892216a6851307c822a71841ad2dc986facb77 (diff)
Avoid unnecessary focus changes when creating/killing buffers
* exwm-input.el (exwm-input--skip-buffer-list-update): New internal
variable for skipping the next 'buffer-list-update'.
(exwm-input--on-buffer-list-update): Skip when
`exwm-input--skip-buffer-list-update` is set.

* exwm-manage.el (exwm-manage--manage-window): Set
`exwm-input--skip-buffer-list-update` when creating/killing buffers.
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/exwm-input.el b/exwm-input.el
index b7b55d88f7..39fcbadec8 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -117,6 +117,9 @@ defined in `exwm-mode-map' here."
 
 (defvar exwm-input--simulation-keys nil "Simulation keys in line-mode.")
 
+(defvar exwm-input--skip-buffer-list-update nil
+  "Skip the upcoming 'buffer-list-update'.")
+
 (defvar exwm-input--temp-line-mode nil
   "Non-nil indicates it's in temporary line-mode for char-mode.")
 
@@ -264,6 +267,7 @@ ARGS are additional arguments to CALLBACK."
 (defun exwm-input--on-buffer-list-update ()
   "Run in `buffer-list-update-hook' to track input focus."
   (when (and (not (eq this-command #'handle-switch-frame))
+             (not exwm-input--skip-buffer-list-update)
              (not (exwm-workspace--client-p))
              ;; The following conditions filter out events relating to temp
              ;; buffers.