branch: externals/exwm
commit 2f4e6fea7e3bb609cdc88dbff0bd74cf00b9b630
Author: Steven Allen <ste...@stebalien.com>
Commit: GitHub <nore...@github.com>

    Don't leave the inner window behind when moving floating windows (#73)
    
    Previously, EXWM would leave the inner window behind when dragging
    around floating windows until the mouse was released. Now, the inner
    window will be dragged along without any lag.
    
    * exwm-floating.el (exwm-floating--do-moveresize): drag the inner window
    along with the outer window.
---
 exwm-floating.el | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/exwm-floating.el b/exwm-floating.el
index 9d31f9276c..70b4377600 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -710,17 +710,28 @@ Float resizing is stopped when TYPE is nil."
                          :height height))
       (when (bufferp buffer-or-id)
         ;; Managed.
-        (setq value-mask (logand value-mask (logior xcb:ConfigWindow:Width
-                                                    xcb:ConfigWindow:Height)))
-        (when (/= 0 value-mask)
-          (with-current-buffer buffer-or-id
+        (with-current-buffer buffer-or-id
+          (let ((resize-value-mask
+                 (logand value-mask (logior xcb:ConfigWindow:Width
+                                            xcb:ConfigWindow:Height)))
+                (move-value-mask
+                 (logand value-mask (logior xcb:ConfigWindow:X
+                                            xcb:ConfigWindow:Y))))
+          (when (/= 0 resize-value-mask)
             (xcb:+request exwm--connection
                 (make-instance 'xcb:ConfigureWindow
                                :window (frame-parameter exwm--floating-frame
                                                         'exwm-outer-id)
                                :value-mask value-mask
                                :width width
-                               :height height)))))
+                               :height height)))
+          (when (/= 0 move-value-mask)
+            (xcb:+request exwm--connection
+                (make-instance 'xcb:ConfigureWindow
+                               :window exwm--id
+                               :value-mask value-mask
+                               :x (+ x exwm-floating-border-width)
+                               :y (+ y exwm-floating-border-width)))))))
       (xcb:flush exwm--connection))))
 
 (defun exwm-floating-move (&optional delta-x delta-y)

Reply via email to