about summary refs log tree commit diff
path: root/exwm-systemtray.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2018-02-19T14·40+0800
committerChris Feng <chris.w.feng@gmail.com>2018-02-19T14·40+0800
commit5c5729c0d4832a870a928d6d7cc2f990a7e8f649 (patch)
treefdba54b6a488e4dccd2fdabec866ccbfde30b816 /exwm-systemtray.el
parentb8ce20b4f3eac1228aef58b83a72a87ccdb819d0 (diff)
Fix various issues with multi-monitor support
* exwm-workspace.el (exwm-workspace-switch): Do not hide X windows
when switching to a workspace on another output; update the
timestamp (last switched to) of a workspace frame.
(exwm-workspace-move-window): Do not hide an X window when moving it
to an active workspace on another output.

* exwm-floating.el (exwm-floating--set-floating):
* exwm-layout.el (exwm-layout-set-fullscreen):
* exwm-manage.el (exwm-manage--manage-window)
(exwm-manage--on-ConfigureRequest):
* exwm-systemtray.el (exwm-systemtray--refresh)
(exwm-systemtray--init):
Correct coordinate calculations.

* exwm-workspace.el (exwm-workspace--current-width): Removed since no
longer used.
Diffstat (limited to 'exwm-systemtray.el')
-rw-r--r--exwm-systemtray.el26
1 files changed, 14 insertions, 12 deletions
diff --git a/exwm-systemtray.el b/exwm-systemtray.el
index 5377ef8ed6..d932032e59 100644
--- a/exwm-systemtray.el
+++ b/exwm-systemtray.el
@@ -82,8 +82,6 @@ You shall use the default value if using auto-hide minibuffer."
 (defvar exwm-workspace--workareas)
 (defvar exwm-workspace-current-index)
 (defvar xcb:Atom:_NET_SYSTEM_TRAY_S0)
-(declare-function exwm-workspace--current-height "exwm-workspace.el")
-(declare-function exwm-workspace--current-width  "exwm-workspace.el")
 (declare-function exwm-workspace--minibuffer-own-frame-p "exwm-workspace.el")
 
 (defun exwm-systemtray--embed (icon)
@@ -205,13 +203,15 @@ You shall use the default value if using auto-hide minibuffer."
         (setq x (+ x (slot-value (cdr pair) 'width)
                    exwm-systemtray-icon-gap))
         (setq map t)))
-    (xcb:+request exwm-systemtray--connection
-        (make-instance 'xcb:ConfigureWindow
-                       :window exwm-systemtray--embedder
-                       :value-mask (logior xcb:ConfigWindow:X
-                                           xcb:ConfigWindow:Width)
-                       :x (- (exwm-workspace--current-width) x)
-                       :width x))
+    (let ((workarea (elt exwm-workspace--workareas
+                         exwm-workspace-current-index)))
+      (xcb:+request exwm-systemtray--connection
+          (make-instance 'xcb:ConfigureWindow
+                         :window exwm-systemtray--embedder
+                         :value-mask (logior xcb:ConfigWindow:X
+                                             xcb:ConfigWindow:Width)
+                         :x (- (aref workarea 2) x)
+                         :width x)))
     (when map
       (xcb:+request exwm-systemtray--connection
           (make-instance 'xcb:MapWindow :window exwm-systemtray--embedder))))
@@ -434,9 +434,11 @@ You shall use the default value if using auto-hide minibuffer."
                     (- (line-pixel-height) exwm-systemtray-height)
                   ;; Vertically centered.
                   (/ (- (line-pixel-height) exwm-systemtray-height) 2)))
-      (setq frame exwm-workspace--current
-            ;; Bottom aligned.
-            y (- (exwm-workspace--current-height) exwm-systemtray-height)))
+      (let ((workarea (elt exwm-workspace--workareas
+                           exwm-workspace-current-index)))
+        (setq frame exwm-workspace--current
+              ;; Bottom aligned.
+              y (- (aref workarea 3) exwm-systemtray-height))))
     (setq parent (string-to-number (frame-parameter frame 'window-id))
           depth (slot-value (xcb:+request-unchecked+reply
                                 exwm-systemtray--connection