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-08-09T03·27+0800
committerChris Feng <chris.w.feng@gmail.com>2015-08-09T03·27+0800
commit36bb5793c2026230a2a660d443dde1c3b1a98de6 (patch)
treedc46b4ffab30b72dab5c46be7dd6c0b608256f36 /exwm-layout.el
parent42f4ec6db50fc0d62792847e63349c46b056ad8f (diff)
Refresh when minibuffer grows (fix #10)
The expansion of echo area is not handled however.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index 906357ed34..414aa37cbc 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -187,10 +187,21 @@
                 (dolist (i (cdr windows))
                   (set-window-buffer i placeholder))))))))))
 
+(defun exwm-layout--on-minibuffer-setup ()
+  "Refresh layout when minibuffer grows."
+  (run-with-idle-timer 0.01 nil         ;FIXME
+                       (lambda ()
+                         (when (and (< 1 (window-height (minibuffer-window)))
+                                    (not (and (eq major-mode 'exwm-mode)
+                                              exwm--floating-frame)))
+                           (exwm-layout--refresh)))))
+
 (defun exwm-layout--init ()
   "Initialize layout module."
   ;; Auto refresh layout
-  (add-hook 'window-configuration-change-hook 'exwm-layout--refresh))
+  (add-hook 'window-configuration-change-hook 'exwm-layout--refresh)
+  ;; Refresh when minibuffer grows
+  (add-hook 'minibuffer-setup-hook 'exwm-layout--on-minibuffer-setup t))