Fix #1509: failure to resize certain popups

This commit is contained in:
Henrik Lissner 2019-06-24 21:42:23 +02:00
parent 168c1d5e61
commit 26da625981
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -114,22 +114,14 @@ windows (unlike `doom/window-maximize-buffer') Activate again to undo."
(assq ?_ register-alist)) (assq ?_ register-alist))
(ignore (ignore-errors (jump-to-register ?_))) (ignore (ignore-errors (jump-to-register ?_)))
(window-configuration-to-register ?_) (window-configuration-to-register ?_)
(if (window-dedicated-p) (let ((dedicated-p (window-dedicated-p)))
;; `window-resize' and `window-max-delta' don't respect (unwind-protect
;; `ignore-window-parameters', so we gotta force it to. (progn
(cl-letf* ((old-window-resize (symbol-function #'window-resize)) (when dedicated-p
(old-window-max-delta (symbol-function #'window-max-delta)) (set-window-dedicated-p nil nil))
((symbol-function #'window-resize) (maximize-window))
(lambda (window delta &optional horizontal _ignore pixelwise) (set-window-dedicated-p nil dedicated-p))
(funcall old-window-resize window delta horizontal t))))
t pixelwise)))
((symbol-function #'window-max-delta)
(lambda (&optional window horizontal _ignore trail noup nodown pixelwise)
(funcall old-window-max-delta window horizontal t
trail noup nodown pixelwise))))
(maximize-window))
(maximize-window))
t)))
;;;###autoload ;;;###autoload
(defun doom/window-maximize-horizontally () (defun doom/window-maximize-horizontally ()