about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--exwm-input.el17
-rw-r--r--exwm.el7
2 files changed, 13 insertions, 11 deletions
diff --git a/exwm-input.el b/exwm-input.el
index d14b0b52d5ec..3a817be4cd6e 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)))
 
@@ -394,10 +397,8 @@ This value should always be overwritten.")
   (when (called-interactively-p 'any)
     (exwm-input--update-global-prefix-keys)))
 
-;; FIXME: Putting (t . EVENT) into `unread-command-events' does not really work
-;;        as documented in Emacs 24.  Since inserting a conventional EVENT does
-;;        add it into (this-command-keys) there, we use `unread-command-events'
-;;        differently on Emacs 24 and 25.
+;; Putting (t . EVENT) into `unread-command-events' does not really work
+;; as documented for Emacs < 27.
 (eval-and-compile
   (if (< emacs-major-version 27)
       (defsubst exwm-input--unread-event (event)
@@ -632,8 +633,6 @@ This value should always be overwritten.")
             (setq key (read-key (format "Send key: %s (%d/%d)"
                                         (key-description keys)
                                         (1+ i) times)))
-            (when (and (listp key) (eq (car key) t))
-              (setq key (cdr key)))
             (unless (listp key) (throw 'break nil)))))
       (setq keys (vconcat keys (vector key)))
       (exwm-input--fake-key key))))
diff --git a/exwm.el b/exwm.el
index 8ef1fc4fe78e..fe1024676b76 100644
--- a/exwm.el
+++ b/exwm.el
@@ -726,8 +726,11 @@
      ;; Ignore unrecognized command line arguments.  This can be helpful
      ;; when EXWM is launched by some session manager.
      (push #'vector command-line-functions)
-     (add-hook 'window-setup-hook #'exwm-init t)          ;for Emacs
-     (add-hook 'after-make-frame-functions #'exwm-init t) ;for Emacs Client
+     (if (display-graphic-p)
+         ;; emacs.
+         (add-hook 'window-setup-hook #'exwm-init t)
+       ;; emacsclient.
+       (add-hook 'after-make-frame-functions #'exwm-init t))
      (add-hook 'kill-emacs-hook #'exwm--server-stop)
      (dolist (i exwm-blocking-subrs)
        (advice-add i :around #'exwm--server-eval-at)))))