Fix various input focus issues

* exwm-input.el (exwm-input--on-buffer-list-update): Cancel the frame
redirection introduced by 421c0512f7.

* exwm-input.el (exwm-input--on-buffer-list-update): Only ignore temp
buffers just switched from.

* exwm-input.el (exwm-input--update-focus-commit): New function for
ensuring the input focus lock can always be released.
(exwm-input--update-focus-defer, exwm-input--update-focus): Use it.

* exwm-input.el (exwm-input--update-focus): No need to select frames;
only transfer X input focus.

* exwm-core.el (exwm--defer): New macro for correcting the use of
`run-with-idle-timer' by taking `current-idle-time' into account.
* exwm-input.el (exwm-input--update-focus-defer)
(exwm-input--update-focus):
* exwm-layout.el (exwm-layout--on-minibuffer-setup)
(exwm-layout--on-echo-area-change):
* exwm-manage.el (exwm-manage--unmanage-window)
(exwm-workspace--prompt-delete):
* exwm-workspace.el (exwm-workspace-switch)
(exwm-workspace--add-frame-as-workspace):
Use it.
This commit is contained in:
Chris Feng 2017-11-19 14:51:45 +08:00
parent 55626530f4
commit 71a39840b2
5 changed files with 39 additions and 31 deletions

View file

@ -407,10 +407,9 @@ selected by `other-buffer'."
(defun exwm-layout--on-minibuffer-setup ()
"Refresh layout when minibuffer grows."
(unless (exwm-workspace--client-p)
(run-with-idle-timer 0.01 nil ;FIXME
(lambda ()
(when (< 1 (window-height (minibuffer-window)))
(exwm-layout--refresh))))))
(exwm--defer 0 (lambda ()
(when (< 1 (window-height (minibuffer-window)))
(exwm-layout--refresh))))))
(defun exwm-layout--on-echo-area-change (&optional dirty)
"Run when message arrives or in `echo-area-clear-hook' to refresh layout."
@ -421,7 +420,7 @@ selected by `other-buffer'."
(frame-width exwm-workspace--current))))
(if dirty
(exwm-layout--refresh)
(run-with-idle-timer 0.01 nil #'exwm-layout--refresh)))) ;FIXME
(exwm--defer 0 #'exwm-layout--refresh))))
;;;###autoload
(defun exwm-layout-enlarge-window (delta &optional horizontal)