about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-02-06T21·43+0100
committerFelix Lange <fjl@twurst.com>2016-02-06T21·43+0100
commit00065234749054940563f59a0027a53bc5ebffad (patch)
tree5215c9f0965cc3c7e94cd39b14b39de30a9af26c /exwm-layout.el
parent97daba20ad22f05f2e4c1347ff86d6c957142a0a (diff)
Resize minibuffer only when it's in its own frame
0e4055d3392 introduced a few calls to exwm-workspace--resize-minibuffer
in various places. This function only works when the minibuffer is
displayed in its own frame but was called unconditionally in some cases.

Fix it by wrapping all calls in an appropriate conditional and add an
assertion. Also rename the function so it is clearer that it resizes a
frame, which might prevent calling it unconditionally in the future.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index 0dc5e1ac02..871438f9f6 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -203,8 +203,9 @@
         (id (frame-parameter frame 'exwm-outer-id))
         (workspace (frame-parameter frame 'exwm-workspace)))
     (with-slots (x y width height) geometry
-      (when (eq frame exwm-workspace--current)
-        (exwm-workspace--resize-minibuffer width height))
+      (when (and (eq frame exwm-workspace--current)
+                 (exwm-workspace--minibuffer-own-frame-p))
+        (exwm-workspace--resize-minibuffer-frame width height))
       (exwm-layout--resize-container id workspace x y width height)
       (xcb:flush exwm--connection))))
 
@@ -395,7 +396,7 @@ See also `exwm-layout-enlarge-window'."
   "Initialize layout module."
   ;; Auto refresh layout
   (add-hook 'window-configuration-change-hook #'exwm-layout--refresh)
-  (unless (memq exwm-workspace-minibuffer-position '(top bottom))
+  (unless (exwm-workspace--minibuffer-own-frame-p)
     ;; Refresh when minibuffer grows
     (add-hook 'minibuffer-setup-hook #'exwm-layout--on-minibuffer-setup t)
     (run-with-idle-timer 0 t #'exwm-layout--on-echo-area-change t)