mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 14:57:59 +01:00
Always update input focus on entering minibuffer
* exwm-input.el (exwm-input--on-minibuffer-setup): New function for setting input focus on the workspace frame. (exwm-input--init): Add the function to `minibuffer-setup-hook'. * exwm-workspace.el (exwm-workspace--on-minibuffer-setup): Avoid setting input focus here.
This commit is contained in:
parent
fdeb39dc08
commit
e6bf1b45ad
2 changed files with 8 additions and 3 deletions
|
@ -174,6 +174,11 @@ This value should always be overwritten.")
|
||||||
(xcb:flush exwm--connection)))))
|
(xcb:flush exwm--connection)))))
|
||||||
(setq exwm-input--update-focus-lock nil))
|
(setq exwm-input--update-focus-lock nil))
|
||||||
|
|
||||||
|
(defun exwm-input--on-minibuffer-setup ()
|
||||||
|
"Run in `minibuffer-setup-hook' to set input focus."
|
||||||
|
;; Set input focus on the Emacs frame
|
||||||
|
(x-focus-frame (window-frame (minibuffer-selected-window))))
|
||||||
|
|
||||||
(defun exwm-input--set-active-window (&optional id)
|
(defun exwm-input--set-active-window (&optional id)
|
||||||
"Set _NET_ACTIVE_WINDOW."
|
"Set _NET_ACTIVE_WINDOW."
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
|
@ -604,6 +609,8 @@ Its usage is the same with `exwm-input-set-simulation-keys'."
|
||||||
#'exwm-floating--stop-moveresize)
|
#'exwm-floating--stop-moveresize)
|
||||||
(xcb:+event exwm--connection 'xcb:MotionNotify
|
(xcb:+event exwm--connection 'xcb:MotionNotify
|
||||||
#'exwm-floating--do-moveresize)
|
#'exwm-floating--do-moveresize)
|
||||||
|
;; The input focus should be set on the frame when minibuffer is active.
|
||||||
|
(add-hook 'minibuffer-setup-hook #'exwm-input--on-minibuffer-setup)
|
||||||
;; `pre-command-hook' marks the end of a key sequence (existing or not)
|
;; `pre-command-hook' marks the end of a key sequence (existing or not)
|
||||||
(add-hook 'pre-command-hook #'exwm-input--finish-key-sequence)
|
(add-hook 'pre-command-hook #'exwm-input--finish-key-sequence)
|
||||||
;; Control `exwm-input--during-command'
|
;; Control `exwm-input--during-command'
|
||||||
|
|
|
@ -996,9 +996,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
;; Exclude non-graphical frames.
|
;; Exclude non-graphical frames.
|
||||||
(frame-parameter nil 'exwm-outer-id))
|
(frame-parameter nil 'exwm-outer-id))
|
||||||
(add-hook 'post-command-hook #'exwm-workspace--update-minibuffer-height)
|
(add-hook 'post-command-hook #'exwm-workspace--update-minibuffer-height)
|
||||||
(exwm-workspace--show-minibuffer)
|
(exwm-workspace--show-minibuffer)))
|
||||||
;; Set input focus on the Emacs frame
|
|
||||||
(x-focus-frame (window-frame (minibuffer-selected-window)))))
|
|
||||||
|
|
||||||
(defun exwm-workspace--on-minibuffer-exit ()
|
(defun exwm-workspace--on-minibuffer-exit ()
|
||||||
"Run in minibuffer-exit-hook to hide the minibuffer container."
|
"Run in minibuffer-exit-hook to hide the minibuffer container."
|
||||||
|
|
Loading…
Reference in a new issue