From 397ca5497e82168b0de1cac9a2204dc695b1de5a Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Sun, 17 Mar 2019 00:00:00 +0000 Subject: [PATCH] Remove loading order dependency on `mouse-autoselect-window' * exwm-core.el (exwm--get-client-event-mask): Renamed from `exwm--client-event-mask' and used as a function. * exwm-floating.el (exwm-floating--unset-floating): * exwm-layout.el (exwm-layout--hide): * exwm-manage.el (exwm-manage--manage-window): Use it. --- exwm-core.el | 11 ++++++----- exwm-floating.el | 2 +- exwm-layout.el | 2 +- exwm-manage.el | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/exwm-core.el b/exwm-core.el index 55fbecd..39928e1 100644 --- a/exwm-core.el +++ b/exwm-core.el @@ -150,11 +150,12 @@ least SECS seconds later." ,function ,@args)) -(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.") +(defun exwm--get-client-event-mask () + "Return event mask set on all managed windows." + (logior xcb:EventMask:StructureNotify + xcb:EventMask:PropertyChange + (if mouse-autoselect-window + xcb:EventMask:EnterWindow 0))) ;; Internal variables (defvar-local exwm--id nil) ;window ID diff --git a/exwm-floating.el b/exwm-floating.el index b7430d7..7ac2c27 100644 --- a/exwm-floating.el +++ b/exwm-floating.el @@ -342,7 +342,7 @@ This is also used by X window containers.") (xcb:+request exwm--connection (make-instance 'xcb:ChangeWindowAttributes :window id :value-mask xcb:CW:EventMask - :event-mask exwm--client-event-mask)) + :event-mask (exwm--get-client-event-mask))) ;; Reparent the floating frame back to the root window. (let ((frame-id (frame-parameter exwm--floating-frame 'exwm-outer-id)) (frame-container (frame-parameter exwm--floating-frame diff --git a/exwm-layout.el b/exwm-layout.el index 52fd08e..9ef516b 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -158,7 +158,7 @@ (xcb:+request exwm--connection (make-instance 'xcb:ChangeWindowAttributes :window id :value-mask xcb:CW:EventMask - :event-mask exwm--client-event-mask)) + :event-mask (exwm--get-client-event-mask))) (exwm-layout--set-state id xcb:icccm:WM_STATE:IconicState) (exwm-layout--auto-iconify) (xcb:flush exwm--connection)))) diff --git a/exwm-manage.el b/exwm-manage.el index b41512c..5c32284 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -195,7 +195,7 @@ You can still make the X windows floating afterwards." (when (xcb:+request-checked+request-check exwm--connection (make-instance 'xcb:ChangeWindowAttributes :window id :value-mask xcb:CW:EventMask - :event-mask exwm--client-event-mask)) + :event-mask (exwm--get-client-event-mask))) (throw 'return 'dead)) ;; Add this X window to save-set. (xcb:+request exwm--connection @@ -257,7 +257,7 @@ You can still make the X windows floating afterwards." exwm-window-type) ;; Listen for PropertyChange (struts) and ;; UnmapNotify/DestroyNotify event of the dock. - exwm--client-event-mask + (exwm--get-client-event-mask) xcb:EventMask:NoEvent))) ;; The window needs to be mapped (xcb:+request exwm--connection