about summary refs log tree commit diff
path: root/exwm-workspace.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-07-30T02·17+0800
committerChris Feng <chris.w.feng@gmail.com>2016-07-30T02·17+0800
commitd225f191a908346535cf4525a4c6c56d93a84b31 (patch)
tree6d49d092f405210658dcbd41748d93e94f2bd962 /exwm-workspace.el
parentaa7de9dc6f13b0d937fe265b64368b7be6e8798e (diff)
Fit the *Completions* buffer
* exwm-workspace.el (exwm-workspace--on-minibuffer-setup): Work around
the *Completions* buffer not getting fitted problem.

* exwm.el (exwm-enable): Enable `window-resize-pixelwise'.
Diffstat (limited to 'exwm-workspace.el')
-rw-r--r--exwm-workspace.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index b2a0cab153e1..b425f9249b32 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -986,7 +986,17 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
              ;; Exclude non-graphical frames.
              (frame-parameter nil 'exwm-outer-id))
     (add-hook 'post-command-hook #'exwm-workspace--update-minibuffer-height)
-    (exwm-workspace--show-minibuffer)))
+    (exwm-workspace--show-minibuffer))
+  ;; FIXME: This is a temporary fix for the *Completions* buffer not
+  ;;        being correctly fitted by its displaying window.  As with
+  ;;        `exwm-workspace--display-buffer', the problem is caused by
+  ;;        the fact that the minibuffer (rather than the workspace)
+  ;;        frame is the 'selected frame'.  `get-buffer-window' will
+  ;;        fail to retrieve the correct window.  It's likely there are
+  ;;        other related issues.
+  (let ((window (get-buffer-window "*Completions*" exwm-workspace--current)))
+    (when window
+      (fit-window-to-buffer window nil nil nil nil t))))
 
 (defun exwm-workspace--on-minibuffer-exit ()
   "Run in minibuffer-exit-hook to hide the minibuffer container."