aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/window.el39
1 files changed, 20 insertions, 19 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 8cb9670ae47..8597f870a5b 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -434,7 +434,8 @@ shorter, explicitly specify the SIZE argument of that function."
434 434
435(defun window-min-pixel-height (&optional window) 435(defun window-min-pixel-height (&optional window)
436 "Return the minimum pixel height of window WINDOW." 436 "Return the minimum pixel height of window WINDOW."
437 (* (max window-min-height window-safe-min-height) 437 (* (max (if (window-minibuffer-p window) 1 window-min-height)
438 window-safe-min-height)
438 (frame-char-size window))) 439 (frame-char-size window)))
439 440
440;; This must go to C, finally (or get removed). 441;; This must go to C, finally (or get removed).
@@ -1603,8 +1604,6 @@ return the minimum pixel-size of WINDOW."
1603 value) 1604 value)
1604 (with-current-buffer (window-buffer window) 1605 (with-current-buffer (window-buffer window)
1605 (cond 1606 (cond
1606 ((window-minibuffer-p window)
1607 (if pixelwise (frame-char-height (window-frame window)) 1))
1608 ((window-size-fixed-p window horizontal ignore) 1607 ((window-size-fixed-p window horizontal ignore)
1609 ;; The minimum size of a fixed size window is its size. 1608 ;; The minimum size of a fixed size window is its size.
1610 (window-size window horizontal pixelwise)) 1609 (window-size window horizontal pixelwise))
@@ -2739,30 +2738,32 @@ windows."
2739 (when (window-right window) 2738 (when (window-right window)
2740 (window--resize-reset-1 (window-right window) horizontal))) 2739 (window--resize-reset-1 (window-right window) horizontal)))
2741 2740
2741;; The following is the internal function used when resizing mini
2742;; windows "manually", for example, when dragging a divider between
2743;; root and mini window. The routines for automatic minibuffer window
2744;; resizing call `window--resize-root-window-vertically' instead.
2742(defun window--resize-mini-window (window delta) 2745(defun window--resize-mini-window (window delta)
2743 "Resize minibuffer window WINDOW by DELTA pixels. 2746 "Change height of mini window WINDOW by DELTA pixels.
2744If WINDOW cannot be resized by DELTA pixels make it as large (or 2747If WINDOW cannot be resized by DELTA pixels make it as large (or
2745as small) as possible, but don't signal an error." 2748as small) as possible, but don't signal an error."
2746 (when (window-minibuffer-p window) 2749 (when (window-minibuffer-p window)
2747 (let* ((frame (window-frame window)) 2750 (let* ((frame (window-frame window))
2748 (root (frame-root-window frame)) 2751 (root (frame-root-window frame))
2749 (height (window-pixel-height window)) 2752 (height (window-pixel-height window))
2750 (min-delta 2753 (min-height (+ (frame-char-height frame)
2751 (- (window-pixel-height root) 2754 (- (window-pixel-height window)
2752 (window-min-size root nil nil t)))) 2755 (window-body-height window t))))
2753 ;; Sanitize DELTA. 2756 (max-delta (- (window-pixel-height root)
2754 (cond 2757 (window-min-size root nil nil t))))
2755 ((<= (+ height delta) 0) 2758 ;; Don't make mini window too small.
2756 (setq delta (- (frame-char-height frame) height))) 2759 (when (< (+ height delta) min-height)
2757 ((> delta min-delta) 2760 (setq delta (- min-height height)))
2758 (setq delta min-delta))) 2761 ;; Don't make root window too small.
2762 (when (> delta max-delta)
2763 (setq delta max-delta))
2759 2764
2760 (unless (zerop delta) 2765 (unless (zerop delta)
2761 ;; Resize now.
2762 (window--resize-reset frame) 2766 (window--resize-reset frame)
2763 ;; Ideally we should be able to resize just the last child of root
2764 ;; here. See the comment in `resize-root-window-vertically' for
2765 ;; why we do not do that.
2766 (window--resize-this-window root (- delta) nil nil t) 2767 (window--resize-this-window root (- delta) nil nil t)
2767 (set-window-new-pixel window (+ height delta)) 2768 (set-window-new-pixel window (+ height delta))
2768 ;; The following routine catches the case where we want to resize 2769 ;; The following routine catches the case where we want to resize
@@ -5881,7 +5882,7 @@ value can be also stored on disk and read back in a new session."
5881 (let ((scroll-bars (cdr (assq 'scroll-bars state)))) 5882 (let ((scroll-bars (cdr (assq 'scroll-bars state))))
5882 (set-window-scroll-bars 5883 (set-window-scroll-bars
5883 window (car scroll-bars) (nth 2 scroll-bars) 5884 window (car scroll-bars) (nth 2 scroll-bars)
5884 (nth 3 scroll-bars) (nth 5 scroll-bars))) 5885 (nth 3 scroll-bars) (nth 5 scroll-bars) (nth 6 scroll-bars)))
5885 (set-window-vscroll window (cdr (assq 'vscroll state))) 5886 (set-window-vscroll window (cdr (assq 'vscroll state)))
5886 ;; Adjust vertically. 5887 ;; Adjust vertically.
5887 (if (or (memq window-size-fixed '(t height)) 5888 (if (or (memq window-size-fixed '(t height))
@@ -8497,7 +8498,7 @@ parameters of FRAME."
8497 (if parent 8498 (if parent
8498 (frame-native-height parent) 8499 (frame-native-height parent)
8499 (- (nth 3 geometry) (nth 1 geometry)))) 8500 (- (nth 3 geometry) (nth 1 geometry))))
8500 ;; FRAME'S parent or workarea sizes. Used when no margins 8501 ;; FRAME's parent or workarea sizes. Used when no margins
8501 ;; are specified. 8502 ;; are specified.
8502 (parent-or-workarea 8503 (parent-or-workarea
8503 (if parent 8504 (if parent