about summary refs log tree commit diff
path: root/exwm-workspace.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-workspace.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-workspace.el')
-rw-r--r--exwm-workspace.el13
1 files changed, 6 insertions, 7 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index bebd954940f2..d513172b66f5 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -145,7 +145,7 @@ Please manually run the hook `exwm-workspace-list-change-hook' afterwards.")
       (if (eq frame exwm-workspace--current)
           ;; Abort the recursive minibuffer if deleting the current workspace.
           (progn
-            (run-with-idle-timer 0 nil #'delete-frame frame)
+            (exwm--defer 0 #'delete-frame frame)
             (abort-recursive-edit))
         (delete-frame frame)
         (exwm-workspace--update-switch-history)
@@ -488,10 +488,10 @@ The optional FORCE option is for internal use only."
       (set-frame-parameter frame 'exwm-selected-window nil)
       ;; Close the (possible) active minibuffer
       (when (active-minibuffer-window)
-        (run-with-idle-timer 0 nil (lambda ()
-                                     ;; Might be aborted by then.
-                                     (when (active-minibuffer-window)
-                                       (abort-recursive-edit)))))
+        (exwm--defer 0 (lambda ()
+                         ;; Might be aborted by then.
+                         (when (active-minibuffer-window)
+                           (abort-recursive-edit)))))
       (if (exwm-workspace--minibuffer-own-frame-p)
           ;; Resize the minibuffer frame.
           (exwm-workspace--resize-minibuffer-frame)
@@ -1275,8 +1275,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
           (make-instance 'xcb:MapWindow :window workspace)))
     (xcb:flush exwm--connection)
     ;; Delay making the workspace fullscreen until Emacs becomes idle
-    (run-with-idle-timer 0 nil #'set-frame-parameter
-                         frame 'fullscreen 'fullboth)
+    (exwm--defer 0 #'set-frame-parameter frame 'fullscreen 'fullboth)
     ;; Update EWMH properties.
     (exwm-workspace--update-ewmh-props)
     (if exwm-workspace--create-silently