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-12-31T12·53+0800
committerChris Feng <chris.w.feng@gmail.com>2017-12-31T12·53+0800
commitdd0a62c405b52244f42fd8a0e72282c742772ad3 (patch)
treefbbd6007d3a38248b101d313807d1fa0ca397251 /exwm-core.el
parent76d6f608bc4a40ff13d102b7482c71ef152a3fa6 (diff)
Add support for `mouse-autoselect-window'
; This feature requires both `mouse-autoselect-window` and
; `focus-follows-mouse' being set.  Delaying autoselection is not
; supported yet.

* exwm-core.el (exwm--client-event-mask): Select the EnterNotify event
on each X window when `mouse-autoselect-window' is set.
* exwm-input.el (exwm-input--on-EnterNotify): New function for making
`mouse-autoselect-window' work on X windows.
(exwm-input--init): Listen to EnterNotify event when
`mouse-autoselect-window' is set.
Diffstat (limited to 'exwm-core.el')
-rw-r--r--exwm-core.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/exwm-core.el b/exwm-core.el
index b0f3ab603c29..ec3efc6e5760 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -86,9 +86,10 @@ least SECS seconds later."
                         ,function
                         ,@args))
 
-(defconst exwm--client-event-mask
-  (eval-when-compile
-    (logior xcb:EventMask:StructureNotify xcb:EventMask:PropertyChange))
+(defconst exwm--client-event-mask (logior xcb:EventMask:StructureNotify
+                                          xcb:EventMask:PropertyChange
+                                          (if mouse-autoselect-window
+                                              xcb:EventMask:EnterWindow 0))
   "Event mask set on all managed windows.")
 
 (defvar exwm-input-line-mode-passthrough)