about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2018-11-03T12·00+0000
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2018-11-03T12·00+0000
commitcd7b32d1c203b87d428ea75e5a5e1452d8236742 (patch)
treed524c1a28a78a36b0a71f91d65d6e90f3c68e239 /exwm-input.el
parent0dd909a11baf3d7d766c1672d726eb59b1474ef2 (diff)
Hide minibuffer upon receiving any event
* exwm-input.el (exwm-input--event-hook): New variable.
(exwm-input--on-ButtonPress, exwm-input--on-KeyPress): Run
`exwm-input--event-hook'.
* exwm-workspace.el (exwm-workspace--init, exwm-workspace--exit):
Hide minibuffer upon noticing an event.
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/exwm-input.el b/exwm-input.el
index c757b09d3fa6..a7fb16a1755f 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -137,6 +137,9 @@ defined in `exwm-mode-map' here."
 (defvar exwm-input--update-focus-window nil "The (Emacs) window to be focused.
 This value should always be overwritten.")
 
+(defvar exwm-input--event-hook nil
+  "Hook to run when EXWM receives an event.")
+
 (defvar exwm-workspace--current)
 (declare-function exwm-floating--do-moveresize "exwm-floating.el"
                   (data _synthetic))
@@ -418,7 +421,8 @@ ARGS are additional arguments to CALLBACK."
                     (setq mode (exwm-input--on-ButtonPress-char-mode)))))))))
     (xcb:+request exwm--connection
         (make-instance 'xcb:AllowEvents :mode mode :time xcb:Time:CurrentTime))
-    (xcb:flush exwm--connection)))
+    (xcb:flush exwm--connection))
+  (run-hooks 'exwm-input--event-hook))
 
 (defun exwm-input--on-KeyPress (data _synthetic)
   "Handle KeyPress event."
@@ -432,7 +436,8 @@ ARGS are additional arguments to CALLBACK."
            (exwm-input--on-KeyPress-line-mode obj data))
           (char-mode
            (exwm-input--on-KeyPress-char-mode obj data)))
-      (exwm-input--on-KeyPress-char-mode obj))))
+      (exwm-input--on-KeyPress-char-mode obj)))
+  (run-hooks 'exwm-input--event-hook))
 
 (defun exwm-input--on-CreateNotify (data _synthetic)
   "Handle CreateNotify events."