about summary refs log tree commit diff
path: root/exwm-systemtray.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2019-08-11T00·00+0000
committerChris Feng <chris.w.feng@gmail.com>2019-08-11T00·00+0000
commit1f2bd54c117b3eeb88b6af1e8627030f00e37898 (patch)
tree678fb7de5ca92765cbb68eacecc80e1d5a03a24d /exwm-systemtray.el
parentdd6f5c36edf62f8c9d3c98a77b0d22b141663f6c (diff)
Fix a regression with systemtray
* exwm-systemtray.el (exwm-systemtray--on-workspace-switch)
(exwm-systemtray--on-randr-refresh): Instead of retrieving the real
frame height, manually calculate it with workarea height and
menu-bar/tool-bar size.
Diffstat (limited to 'exwm-systemtray.el')
-rw-r--r--exwm-systemtray.el40
1 files changed, 25 insertions, 15 deletions
diff --git a/exwm-systemtray.el b/exwm-systemtray.el
index 80505c22a555..a095bfa8de26 100644
--- a/exwm-systemtray.el
+++ b/exwm-systemtray.el
@@ -331,27 +331,37 @@ You shall use the default value if using auto-hide minibuffer."
   "Reparent/Refresh the system tray in `exwm-workspace-switch-hook'."
   (exwm--log)
   (unless (exwm-workspace--minibuffer-own-frame-p)
-    (xcb:+request exwm-systemtray--connection
-        (make-instance 'xcb:ReparentWindow
-                       :window exwm-systemtray--embedder-window
-                       :parent (string-to-number
-                                (frame-parameter exwm-workspace--current
-                                                 'window-id))
-                       :x 0
-                       :y (- (frame-pixel-height exwm-workspace--current)
-                             exwm-systemtray-height))))
+    (let ((geometry (frame-geometry exwm-workspace--current)))
+      (xcb:+request exwm-systemtray--connection
+          (make-instance 'xcb:ReparentWindow
+                         :window exwm-systemtray--embedder-window
+                         :parent (string-to-number
+                                  (frame-parameter exwm-workspace--current
+                                                   'window-id))
+                         :x 0
+                         :y (- (elt (elt exwm-workspace--workareas
+                                         exwm-workspace-current-index)
+                                    3)
+                               (or (cddr (assq 'menu-bar-size geometry)) 0)
+                               (or (cddr (assq 'tool-bar-size geometry)) 0)
+                               exwm-systemtray-height)))))
   (exwm-systemtray--refresh))
 
 (defun exwm-systemtray--on-randr-refresh ()
   "Reposition/Refresh the system tray in `exwm-randr-refresh-hook'."
   (exwm--log)
   (unless (exwm-workspace--minibuffer-own-frame-p)
-    (xcb:+request exwm-systemtray--connection
-        (make-instance 'xcb:ConfigureWindow
-                       :window exwm-systemtray--embedder-window
-                       :value-mask xcb:ConfigWindow:Y
-                       :y (- (frame-pixel-height exwm-workspace--current)
-                             exwm-systemtray-height))))
+    (let ((geometry (frame-geometry exwm-workspace--current)))
+      (xcb:+request exwm-systemtray--connection
+          (make-instance 'xcb:ConfigureWindow
+                         :window exwm-systemtray--embedder-window
+                         :value-mask xcb:ConfigWindow:Y
+                         :y (- (elt (elt exwm-workspace--workareas
+                                         exwm-workspace-current-index)
+                                    3)
+                               (or (cddr (assq 'menu-bar-size geometry)) 0)
+                               (or (cddr (assq 'tool-bar-size geometry)) 0)
+                               exwm-systemtray-height)))))
   (exwm-systemtray--refresh))
 
 (defalias 'exwm-systemtray--on-struts-update