about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2015-09-18T06·17+0800
committerChris Feng <chris.w.feng@gmail.com>2015-09-18T06·17+0800
commit412d2a52bde98bb72fff9a848d5d28b6c5dff4c4 (patch)
tree7b06ec77a1e06b6fc3408626873fc8b7294e83f6 /exwm-layout.el
parent4255f078a690751a20377372be1352698e041ad0 (diff)
Fix wrong/missing ConfigureNotify events
* exwm-floating.el (exwm-floating--set-floating): Set exwm--floating-edges
  as absolute edges (the relative edges can be easily determined).
* exwm-layout.el (exwm-layout--show): Send correct absolute positions to
  floating X windows.

* exwm-floating.el (exwm-floating--stop-moveresize, exwm-floating-move): Send
  ConfigureNotify events after moving floating X windows.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index 2c9ab750b434..13bd08532618 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -40,11 +40,17 @@
   (let* ((buffer (exwm--id->buffer id))
          (edges (or (and buffer
                          (with-current-buffer buffer exwm--floating-edges))
-                    (window-inside-pixel-edges window)))
-         (x (elt edges 0))
-         (y (elt edges 1))
+                    (window-inside-absolute-pixel-edges window)))
          (width (- (elt edges 2) (elt edges 0)))
-         (height (- (elt edges 3) (elt edges 1))))
+         (height (- (elt edges 3) (elt edges 1)))
+         x y)
+    (if exwm--floating-edges
+        ;; The relative position of a floating X window is determinate
+        (setq x exwm-floating-border-width
+              y exwm-floating-border-width)
+      (let ((relative-edges (window-inside-pixel-edges window)))
+        (setq x (elt relative-edges 0)
+              y (elt relative-edges 1))))
     (xcb:+request exwm--connection
         (make-instance 'xcb:ConfigureWindow
                        :window id
@@ -64,7 +70,8 @@
                                (make-instance 'xcb:ConfigureNotify
                                               :event id :window id
                                               :above-sibling xcb:Window:None
-                                              :x x :y y
+                                              :x (elt edges 0)
+                                              :y (elt edges 1)
                                               :width width :height height
                                               :border-width 0
                                               :override-redirect 0)