about summary refs log tree commit diff
path: root/exwm-core.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-core.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-core.el')
-rw-r--r--exwm-core.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/exwm-core.el b/exwm-core.el
index 750f134d1e..146594da0a 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -75,6 +75,15 @@
                                            xcb:EventMask:StructureNotify))))
   (xcb:flush exwm--connection))
 
+(defmacro exwm--defer (secs function &rest args)
+  "Defer the action until SECS seconds later.
+
+The action is to call FUNCTION with arguments ARGS."
+  `(run-with-idle-timer (time-add (or (current-idle-time) 0) ,secs)
+                        nil
+                        ,function
+                        ,@args))
+
 (defconst exwm--client-event-mask
   (eval-when-compile
     (logior xcb:EventMask:StructureNotify xcb:EventMask:PropertyChange))