about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2017-11-19T06·51+0800
committerChris Feng <chris.w.feng@gmail.com>2017-11-19T06·51+0800
commit71a39840b239a51eed7455877517ebe612892eff (patch)
treec1320b3e7c7778e9027d0e2bc7e502d5ee7418bd /exwm-layout.el
parent55626530f4a523cccd1d24c8819f7e80543e0276 (diff)
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.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el9
1 files changed, 4 insertions, 5 deletions
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)