about summary refs log tree commit diff
path: root/exwm-floating.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2015-10-01T01·30+0800
committerChris Feng <chris.w.feng@gmail.com>2015-10-01T01·30+0800
commit3b518eec23e221aa2480970dd35c11c68653869a (patch)
treef35b49d5afe853d170627fa65707c2a3bd52ad1c /exwm-floating.el
parent5184f0d7c1b540a6241904528d068dce288a911e (diff)
Fix a position calculation error on multi-monitor settings
* exwm-floating.el (exwm-floating--set-floating): Always use relative
  positions.
Diffstat (limited to 'exwm-floating.el')
-rw-r--r--exwm-floating.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/exwm-floating.el b/exwm-floating.el
index 59b4e4432d0f..f408cc16b6cb 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -85,8 +85,15 @@
          (x (slot-value exwm--geometry 'x))
          (y (slot-value exwm--geometry 'y))
          (width (slot-value exwm--geometry 'width))
-         (height (slot-value exwm--geometry 'height)))
-    (exwm--log "Floating geometry (original): %dx%d%+d%+d" width height x y)
+         (height (slot-value exwm--geometry 'height))
+         (frame-geometry (frame-parameter original-frame 'exwm-geometry)))
+    (exwm--log "Floating geometry (original, absolute): %dx%d%+d%+d"
+               width height x y)
+    (when frame-geometry
+      (setq x (- x (slot-value frame-geometry 'x))
+            y (- y (slot-value frame-geometry 'y))))
+    (exwm--log "Floating geometry (original, relative): %dx%d%+d%+d"
+               width height x y)
     ;; Save window IDs
     (set-frame-parameter frame 'exwm-window-id frame-id)
     (set-frame-parameter frame 'exwm-outer-id outer-id)