Commit 41cfe0cb authored by Martin Rudalics's avatar Martin Rudalics
Browse files

Fix resizing of minibuffer windows (Bug#11276).

* window.el (adjust-window-trailing-edge, enlarge-window)
(shrink-window, window-resize):
* mouse.el (mouse-drag-line): Fix resizing of minibuffer
windows (Bug#11276).
parent 50e5ebca
2012-04-20 Martin Rudalics <rudalics@gmx.at>
* window.el (adjust-window-trailing-edge, enlarge-window)
(shrink-window, window-resize):
* mouse.el (mouse-drag-line): Fix resizing of minibuffer
windows (Bug#11276).
2012-04-20 Dan Nicolaescu <dann@gnu.org>
* battery.el (battery-echo-area-format): Display remaining time
......
......@@ -404,13 +404,16 @@ must be one of the symbols header, mode, or vertical."
(or mouse-1-click-in-non-selected-windows
(eq window (selected-window)))
(mouse-on-link-p start)))
(enlarge-minibuffer
(resize-minibuffer
;; Resize the minibuffer window if it's on the same frame as
;; and immediately below the position window and it's either
;; active or `resize-mini-windows' is nil.
(and (eq line 'mode)
(not resize-mini-windows)
(eq (window-frame minibuffer-window) frame)
(not (one-window-p t frame))
(= (nth 1 (window-edges minibuffer-window))
(nth 3 (window-edges window)))))
(nth 3 (window-edges window)))
(or (not resize-mini-windows)
(eq minibuffer-window (active-minibuffer-window)))))
(which-side
(and (eq line 'vertical)
(or (cdr (assq 'vertical-scroll-bars (frame-parameters frame)))
......@@ -425,7 +428,7 @@ must be one of the symbols header, mode, or vertical."
((eq line 'mode)
;; Check whether mode-line can be dragged at all.
(when (and (window-at-side-p window 'bottom)
(not enlarge-minibuffer))
(not resize-minibuffer))
(setq done t)))
((eq line 'vertical)
;; Get the window to adjust for the vertical case.
......@@ -499,13 +502,9 @@ must be one of the symbols header, mode, or vertical."
;; Remember that we dragged.
(setq dragged t))
(cond
(enlarge-minibuffer
(adjust-window-trailing-edge window growth))
((eq line 'mode)
(adjust-window-trailing-edge window growth))
(t
(adjust-window-trailing-edge window (- growth)))))))
(if (eq line 'mode)
(adjust-window-trailing-edge window growth)
(adjust-window-trailing-edge window (- growth))))))
;; Presumably, if this was just a click, the last event should be
;; `mouse-1', whereas if this did move the mouse, it should be a
......
......@@ -1486,8 +1486,10 @@ instead."
(cond
((eq window (frame-root-window frame))
(error "Cannot resize the root window of a frame"))
((window-minibuffer-p window)
(window--resize-mini-window window delta))
((window-minibuffer-p window)
(if horizontal
(error "Cannot resize minibuffer window horizontally")
(window--resize-mini-window window delta)))
((window--resizable-p window delta horizontal ignore)
(window--resize-reset frame horizontal)
(window--resize-this-window window delta horizontal ignore t)
......@@ -2002,17 +2004,25 @@ right. If DELTA is less than zero, move the edge upwards or to
the left. If the edge can't be moved by DELTA lines or columns,
move it as far as possible in the desired direction."
(setq window (window-normalize-window window))
(let ((frame (window-frame window))
(right window)
left this-delta min-delta max-delta)
(let* ((frame (window-frame window))
(minibuffer-window (minibuffer-window frame))
(right window)
left this-delta min-delta max-delta)
;; Find the edge we want to move.
(while (and (or (not (window-combined-p right horizontal))
(not (window-right right)))
(setq right (window-parent right))))
(cond
((and (not right) (not horizontal) (not resize-mini-windows)
(eq (window-frame (minibuffer-window frame)) frame))
(window--resize-mini-window (minibuffer-window frame) (- delta)))
((and (not right) (not horizontal)
;; Resize the minibuffer window if it's on the same frame as
;; and immediately below WINDOW and it's either active or
;; `resize-mini-windows' is nil.
(eq (window-frame minibuffer-window) frame)
(= (nth 1 (window-edges minibuffer-window))
(nth 3 (window-edges window)))
(or (not resize-mini-windows)
(eq minibuffer-window (active-minibuffer-window))))
(window--resize-mini-window minibuffer-window (- delta)))
((or (not (setq left right)) (not (setq right (window-right right))))
(if horizontal
(error "No window on the right of this one")
......@@ -2113,6 +2123,10 @@ Return nil."
((zerop delta))
((window-size-fixed-p nil horizontal)
(error "Selected window has fixed size"))
((window-minibuffer-p)
(if horizontal
(error "Cannot resize minibuffer window horizontally")
(window--resize-mini-window (selected-window) delta)))
((window--resizable-p nil delta horizontal)
(window-resize nil delta horizontal))
(t
......@@ -2135,6 +2149,10 @@ Return nil."
((zerop delta))
((window-size-fixed-p nil horizontal)
(error "Selected window has fixed size"))
((window-minibuffer-p)
(if horizontal
(error "Cannot resize minibuffer window horizontally")
(window--resize-mini-window (selected-window) (- delta))))
((window--resizable-p nil (- delta) horizontal)
(window-resize nil (- delta) horizontal))
(t
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment