about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2019-10-02T00·00+0000
committerChris Feng <chris.w.feng@gmail.com>2019-10-02T00·00+0000
commit1e9be0de384d0750277b350c77e5e4a5d8a8ae10 (patch)
tree7a53f7ce3caedcb51dde591005848dbc74c96453
parent9eed52ee2b5a1366dfa5fdd3ad45328c554b356c (diff)
Fix detection of `exwm-workspace--window-y-offset'
* exwm-workspace.el (exwm-workspace--update-offsets): Explicitly
request the geometry of the container for the first workspace as it
may not align with the top of the root X window.
-rw-r--r--exwm-workspace.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 736f46f82c59..705da308f225 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -417,13 +417,19 @@ NIL if FRAME is not a workspace"
       (with-slots (y)
           (xcb:+request-unchecked+reply exwm--connection
               (make-instance 'xcb:GetGeometry
-                             :drawable (frame-parameter frame 'exwm-outer-id)))
+                             :drawable (frame-parameter frame
+                                                        'exwm-container)))
         (with-slots ((y* y))
             (xcb:+request-unchecked+reply exwm--connection
                 (make-instance 'xcb:GetGeometry
-                               :drawable (frame-parameter frame 'exwm-id)))
-          (setq exwm-workspace--frame-y-offset (- y* y)
-                exwm-workspace--window-y-offset (- (elt edges 1) y)))))))
+                               :drawable (frame-parameter frame
+                                                          'exwm-outer-id)))
+          (with-slots ((y** y))
+              (xcb:+request-unchecked+reply exwm--connection
+                  (make-instance 'xcb:GetGeometry
+                                 :drawable (frame-parameter frame 'exwm-id)))
+            (setq exwm-workspace--frame-y-offset (- y** y*)
+                  exwm-workspace--window-y-offset (- (elt edges 1) y))))))))
 
 (defun exwm-workspace--set-active (frame active)
   "Make frame FRAME active on its monitor."