about summary refs log tree commit diff
path: root/exwm-workspace.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2017-02-24T15·05+0800
committerChris Feng <chris.w.feng@gmail.com>2017-02-24T15·13+0800
commitf299ca5ed7056842aa59e9978061bca650316a71 (patch)
tree3aadb06fdc9fddd89c8697ae0525622df3720377 /exwm-workspace.el
parent0ae1e7327ea900ad1b35ce145db63cb0837251de (diff)
Fix systemtray position
* exwm-workspace.el (exwm-workspace--update-workareas-hook): New hook
run when workareas get updated.
(exwm-workspace--update-workareas): Run the hook.
* exwm-systemtray.el (exwm-systemtray--on-workspace-switch)
(exwm-systemtray--on-randr-refresh): Take struts into account when
calculating the position for systemtray.
(exwm-systemtray--on-struts-update): Alias of
`exwm-systemtray--on-randr-refresh'.
(exwm-systemtray--init, exwm-systemtray--exit): Manipulate
`exwm-workspace--update-workareas-hook'.
Diffstat (limited to 'exwm-workspace.el')
-rw-r--r--exwm-workspace.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 17aa2c08cb..66865989dd 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -247,6 +247,8 @@ Value nil means to use the default position which is fixed at bottom, while
                     (append exwm-workspace--struts (list struts*))))))))))
 
 (defvar exwm-workspace--workareas nil "Workareas (struts excluded).")
+(defvar exwm-workspace--update-workareas-hook nil
+  "Normal hook run when workareas get updated.")
 
 (defun exwm-workspace--update-workareas ()
   "Update `exwm-workspace--workareas'."
@@ -309,7 +311,8 @@ Value nil means to use the default position which is fixed at bottom, while
              (cl-incf (aref w 3) delta))))))
     ;; Save the result.
     (setq exwm-workspace--workareas workareas)
-    (xcb:flush exwm--connection)))
+    (xcb:flush exwm--connection))
+  (run-hooks 'exwm-workspace--update-workareas-hook))
 
 (defvar exwm-workspace--fullscreen-frame-count 0
   "Count the fullscreen workspace frames.")