about summary refs log tree commit diff
path: root/exwm-floating.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-09-23T10·36+0800
committerChris Feng <chris.w.feng@gmail.com>2016-09-23T10·36+0800
commit2597f74c7fb9ad290a45c89d0025bebcf739a976 (patch)
tree25e1517488830430dec44b1ea819a7c282450013 /exwm-floating.el
parent0833e8dc4a3fdb6f0ea9651ece2e7d2d4fae97ec (diff)
Remember the geometries of floating X windows
* exwm-floating.el (exwm-floating--stop-moveresize):
* exwm-layout.el (exwm-layout-enlarge-window):
Update the geometry after resizing.
Diffstat (limited to 'exwm-floating.el')
-rw-r--r--exwm-floating.el31
1 files changed, 22 insertions, 9 deletions
diff --git a/exwm-floating.el b/exwm-floating.el
index f2cc09be46..5b8cc89abc 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -550,22 +550,35 @@ context of the corresponding buffer.")
              ;; Unmanaged.
              (eq major-mode 'exwm-mode))
     (let ((edges (window-inside-absolute-pixel-edges (frame-selected-window)))
-          (id (buffer-local-value 'exwm--id
-                                  (window-buffer (frame-selected-window)))))
+          x y width height id)
+      (setq x (pop edges)
+            y (pop edges)
+            width (- (pop edges) x)
+            height (- (pop edges) y))
+      (with-current-buffer (window-buffer (frame-selected-window))
+        (setq id exwm--id)
+        (with-slots ((x* x)
+                     (y* y)
+                     (width* width)
+                     (height* height))
+            exwm--geometry
+          (setf x* x
+                y* y
+                width* width
+                height* height)))
       (xcb:+request exwm--connection
           (make-instance 'xcb:SendEvent
-                         :propagate 0 :destination id
+                         :propagate 0
+                         :destination id
                          :event-mask xcb:EventMask:StructureNotify
                          :event (xcb:marshal
                                  (make-instance 'xcb:ConfigureNotify
                                                 :event id :window id
                                                 :above-sibling xcb:Window:None
-                                                :x (elt edges 0)
-                                                :y (elt edges 1)
-                                                :width (- (elt edges 2)
-                                                          (elt edges 0))
-                                                :height (- (elt edges 3)
-                                                           (elt edges 1))
+                                                :x x
+                                                :y y
+                                                :width width
+                                                :height height
                                                 :border-width 0
                                                 :override-redirect 0)
                                  exwm--connection)))))