From 71a39840b239a51eed7455877517ebe612892eff Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Sun, 19 Nov 2017 14:51:45 +0800 Subject: 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. --- exwm-layout.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'exwm-layout.el') diff --git a/exwm-layout.el b/exwm-layout.el index ba7f65cf3bab..29273a933e2d 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -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) -- cgit 1.4.1