From 5c5729c0d4832a870a928d6d7cc2f990a7e8f649 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Mon, 19 Feb 2018 22:40:27 +0800 Subject: 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. --- exwm-systemtray.el | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'exwm-systemtray.el') 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 -- cgit 1.4.1