about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index c0f3c6147289..e3c1febc4478 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -53,14 +53,6 @@
 (defun exwm-layout--show (id &optional window)
   "Show window ID exactly fit in the Emacs window WINDOW."
   (exwm--log "Show #x%x in %s" id window)
-  (xcb:+request exwm--connection (make-instance 'xcb:MapWindow :window id))
-  (with-current-buffer (exwm--id->buffer id)
-    (xcb:+request exwm--connection
-        (make-instance 'xcb:MapWindow :window exwm--container)))
-  (xcb:+request exwm--connection
-      (make-instance 'xcb:icccm:set-WM_STATE
-                     :window id :state xcb:icccm:WM_STATE:NormalState
-                     :icon xcb:Window:None))
   (let* ((edges (window-inside-absolute-pixel-edges window))
          (width (- (elt edges 2) (elt edges 0)))
          (height (- (elt edges 3) (elt edges 1))))
@@ -93,7 +85,16 @@
                                          (elt relative-edges 0)
                                          (elt relative-edges 1)
                                          width height
-                                         (active-minibuffer-window)))))
+                                         (active-minibuffer-window))))
+      ;; Make the resizing take effect.
+      (xcb:flush exwm--connection)
+      (xcb:+request exwm--connection (make-instance 'xcb:MapWindow :window id))
+      (xcb:+request exwm--connection
+          (make-instance 'xcb:MapWindow :window exwm--container))
+      (xcb:+request exwm--connection
+          (make-instance 'xcb:icccm:set-WM_STATE
+                         :window id :state xcb:icccm:WM_STATE:NormalState
+                         :icon xcb:Window:None)))
     (xcb:+request exwm--connection
         (make-instance 'xcb:SendEvent
                        :propagate 0 :destination id