Another fix for input focus issues

* exwm-core.el (exwm--defer):
* exwm-input.el (exwm-input--update-focus-defer): Avoid unnecessarily
long delay.

* exwm-input.el (exwm-input--on-FocusIn): Filter out FocusIn events
generated as a result of grab/ungrab or when the keyboard is grabbed.
This commit is contained in:
Chris Feng 2017-11-24 22:47:42 +08:00
parent 589b840409
commit dd6596b1f4
2 changed files with 19 additions and 18 deletions

View file

@ -76,10 +76,12 @@
(xcb:flush exwm--connection))
(defmacro exwm--defer (secs function &rest args)
"Defer the action until SECS seconds later.
"Defer the execution of FUNCTION.
The action is to call FUNCTION with arguments ARGS."
`(run-with-idle-timer (time-add (or (current-idle-time) 0) ,secs)
The action is to call FUNCTION with arguments ARGS. If Emacs is not idle,
defer the action until Emacs is idle. Otherwise, defer the action until at
least SECS seconds later."
`(run-with-idle-timer (time-add (or (current-idle-time) (- ,secs)) ,secs)
nil
,function
,@args))