about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2018-10-08T12·00+0000
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2018-10-08T12·00+0000
commitc9984ca2163a18c19f46a90c003569b628de17f0 (patch)
tree43d5be45e874ab43ba3653856022997143ac7630 /exwm-input.el
parent472f7cb82b67b98843f10c12e6bda9b8ae7262bc (diff)
Fix focus jumps with minibuffer-only frames
* exwm-input.el (exwm-input--update-focus): Focus the minibuffer's
frame, which is different than that of the
`minibuffer-selected-window' on minibuffer-only frames.
(exwm-input--on-minibuffer-setup, exwm-input--init)
(exwm-input-exit): Remove unneeded function.
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el12
1 files changed, 1 insertions, 11 deletions
diff --git a/exwm-input.el b/exwm-input.el
index 57fed2d4b88e..876b6a1125d9 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -351,17 +351,10 @@ ARGS are additional arguments to CALLBACK."
                 (x-focus-frame (window-frame window))
               ;; X input focus should be set on the previously selected
               ;; frame.
-              (x-focus-frame (window-frame (minibuffer-selected-window))))
+              (x-focus-frame (window-frame (minibuffer-window))))
             (exwm-input--set-active-window)
             (xcb:flush exwm--connection)))))))
 
-(defun exwm-input--on-minibuffer-setup ()
-  "Run in `minibuffer-setup-hook' to set input focus."
-  (exwm--log)
-  (unless (exwm-workspace--client-p)
-    ;; Set input focus on the Emacs frame
-    (x-focus-frame (window-frame (minibuffer-selected-window)))))
-
 (defun exwm-input--set-active-window (&optional id)
   "Set _NET_ACTIVE_WINDOW."
   (exwm--log)
@@ -1004,8 +997,6 @@ where both ORIGINAL-KEY and SIMULATED-KEY are key sequences."
   (when mouse-autoselect-window
     (xcb:+event exwm--connection 'xcb:EnterNotify
                 #'exwm-input--on-EnterNotify))
-  ;; The input focus should be set on the frame when minibuffer is active.
-  (add-hook 'minibuffer-setup-hook #'exwm-input--on-minibuffer-setup)
   ;; Control `exwm-input--during-command'
   (add-hook 'pre-command-hook #'exwm-input--on-pre-command)
   (add-hook 'post-command-hook #'exwm-input--on-post-command)
@@ -1019,7 +1010,6 @@ where both ORIGINAL-KEY and SIMULATED-KEY are key sequences."
 (defun exwm-input--exit ()
   "Exit the input module."
   (exwm-input--unset-simulation-keys)
-  (remove-hook 'minibuffer-setup-hook #'exwm-input--on-minibuffer-setup)
   (remove-hook 'pre-command-hook #'exwm-input--on-pre-command)
   (remove-hook 'post-command-hook #'exwm-input--on-post-command)
   (remove-hook 'buffer-list-update-hook #'exwm-input--on-buffer-list-update)