aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2012-04-20 10:49:24 +0200
committerMartin Rudalics2012-04-20 10:49:24 +0200
commit41cfe0cb4c3cad4c4a417f8a91eb0180e5cc7211 (patch)
treefe5bca88f83a08cbba4f1dd5ee48f984a928e33a
parent50e5ebca7edcf5299b89ff74499991de01e22046 (diff)
downloademacs-41cfe0cb4c3cad4c4a417f8a91eb0180e5cc7211.tar.gz
emacs-41cfe0cb4c3cad4c4a417f8a91eb0180e5cc7211.zip
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).
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/mouse.el23
-rw-r--r--lisp/window.el34
3 files changed, 44 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ddd306b98df..e139a7b2bba 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12012-04-20 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (adjust-window-trailing-edge, enlarge-window)
4 (shrink-window, window-resize):
5 * mouse.el (mouse-drag-line): Fix resizing of minibuffer
6 windows (Bug#11276).
7
12012-04-20 Dan Nicolaescu <dann@gnu.org> 82012-04-20 Dan Nicolaescu <dann@gnu.org>
2 9
3 * battery.el (battery-echo-area-format): Display remaining time 10 * battery.el (battery-echo-area-format): Display remaining time
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 2e119483797..20a78e55651 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -404,13 +404,16 @@ must be one of the symbols header, mode, or vertical."
404 (or mouse-1-click-in-non-selected-windows 404 (or mouse-1-click-in-non-selected-windows
405 (eq window (selected-window))) 405 (eq window (selected-window)))
406 (mouse-on-link-p start))) 406 (mouse-on-link-p start)))
407 (enlarge-minibuffer 407 (resize-minibuffer
408 ;; Resize the minibuffer window if it's on the same frame as
409 ;; and immediately below the position window and it's either
410 ;; active or `resize-mini-windows' is nil.
408 (and (eq line 'mode) 411 (and (eq line 'mode)
409 (not resize-mini-windows)
410 (eq (window-frame minibuffer-window) frame) 412 (eq (window-frame minibuffer-window) frame)
411 (not (one-window-p t frame))
412 (= (nth 1 (window-edges minibuffer-window)) 413 (= (nth 1 (window-edges minibuffer-window))
413 (nth 3 (window-edges window))))) 414 (nth 3 (window-edges window)))
415 (or (not resize-mini-windows)
416 (eq minibuffer-window (active-minibuffer-window)))))
414 (which-side 417 (which-side
415 (and (eq line 'vertical) 418 (and (eq line 'vertical)
416 (or (cdr (assq 'vertical-scroll-bars (frame-parameters frame))) 419 (or (cdr (assq 'vertical-scroll-bars (frame-parameters frame)))
@@ -425,7 +428,7 @@ must be one of the symbols header, mode, or vertical."
425 ((eq line 'mode) 428 ((eq line 'mode)
426 ;; Check whether mode-line can be dragged at all. 429 ;; Check whether mode-line can be dragged at all.
427 (when (and (window-at-side-p window 'bottom) 430 (when (and (window-at-side-p window 'bottom)
428 (not enlarge-minibuffer)) 431 (not resize-minibuffer))
429 (setq done t))) 432 (setq done t)))
430 ((eq line 'vertical) 433 ((eq line 'vertical)
431 ;; Get the window to adjust for the vertical case. 434 ;; Get the window to adjust for the vertical case.
@@ -499,13 +502,9 @@ must be one of the symbols header, mode, or vertical."
499 ;; Remember that we dragged. 502 ;; Remember that we dragged.
500 (setq dragged t)) 503 (setq dragged t))
501 504
502 (cond 505 (if (eq line 'mode)
503 (enlarge-minibuffer 506 (adjust-window-trailing-edge window growth)
504 (adjust-window-trailing-edge window growth)) 507 (adjust-window-trailing-edge window (- growth))))))
505 ((eq line 'mode)
506 (adjust-window-trailing-edge window growth))
507 (t
508 (adjust-window-trailing-edge window (- growth)))))))
509 508
510 ;; Presumably, if this was just a click, the last event should be 509 ;; Presumably, if this was just a click, the last event should be
511 ;; `mouse-1', whereas if this did move the mouse, it should be a 510 ;; `mouse-1', whereas if this did move the mouse, it should be a
diff --git a/lisp/window.el b/lisp/window.el
index 28abec42680..9afc69d543d 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1486,8 +1486,10 @@ instead."
1486 (cond 1486 (cond
1487 ((eq window (frame-root-window frame)) 1487 ((eq window (frame-root-window frame))
1488 (error "Cannot resize the root window of a frame")) 1488 (error "Cannot resize the root window of a frame"))
1489 ((window-minibuffer-p window) 1489 ((window-minibuffer-p window)
1490 (window--resize-mini-window window delta)) 1490 (if horizontal
1491 (error "Cannot resize minibuffer window horizontally")
1492 (window--resize-mini-window window delta)))
1491 ((window--resizable-p window delta horizontal ignore) 1493 ((window--resizable-p window delta horizontal ignore)
1492 (window--resize-reset frame horizontal) 1494 (window--resize-reset frame horizontal)
1493 (window--resize-this-window window delta horizontal ignore t) 1495 (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
2002the left. If the edge can't be moved by DELTA lines or columns, 2004the left. If the edge can't be moved by DELTA lines or columns,
2003move it as far as possible in the desired direction." 2005move it as far as possible in the desired direction."
2004 (setq window (window-normalize-window window)) 2006 (setq window (window-normalize-window window))
2005 (let ((frame (window-frame window)) 2007 (let* ((frame (window-frame window))
2006 (right window) 2008 (minibuffer-window (minibuffer-window frame))
2007 left this-delta min-delta max-delta) 2009 (right window)
2010 left this-delta min-delta max-delta)
2008 ;; Find the edge we want to move. 2011 ;; Find the edge we want to move.
2009 (while (and (or (not (window-combined-p right horizontal)) 2012 (while (and (or (not (window-combined-p right horizontal))
2010 (not (window-right right))) 2013 (not (window-right right)))
2011 (setq right (window-parent right)))) 2014 (setq right (window-parent right))))
2012 (cond 2015 (cond
2013 ((and (not right) (not horizontal) (not resize-mini-windows) 2016 ((and (not right) (not horizontal)
2014 (eq (window-frame (minibuffer-window frame)) frame)) 2017 ;; Resize the minibuffer window if it's on the same frame as
2015 (window--resize-mini-window (minibuffer-window frame) (- delta))) 2018 ;; and immediately below WINDOW and it's either active or
2019 ;; `resize-mini-windows' is nil.
2020 (eq (window-frame minibuffer-window) frame)
2021 (= (nth 1 (window-edges minibuffer-window))
2022 (nth 3 (window-edges window)))
2023 (or (not resize-mini-windows)
2024 (eq minibuffer-window (active-minibuffer-window))))
2025 (window--resize-mini-window minibuffer-window (- delta)))
2016 ((or (not (setq left right)) (not (setq right (window-right right)))) 2026 ((or (not (setq left right)) (not (setq right (window-right right))))
2017 (if horizontal 2027 (if horizontal
2018 (error "No window on the right of this one") 2028 (error "No window on the right of this one")
@@ -2113,6 +2123,10 @@ Return nil."
2113 ((zerop delta)) 2123 ((zerop delta))
2114 ((window-size-fixed-p nil horizontal) 2124 ((window-size-fixed-p nil horizontal)
2115 (error "Selected window has fixed size")) 2125 (error "Selected window has fixed size"))
2126 ((window-minibuffer-p)
2127 (if horizontal
2128 (error "Cannot resize minibuffer window horizontally")
2129 (window--resize-mini-window (selected-window) delta)))
2116 ((window--resizable-p nil delta horizontal) 2130 ((window--resizable-p nil delta horizontal)
2117 (window-resize nil delta horizontal)) 2131 (window-resize nil delta horizontal))
2118 (t 2132 (t
@@ -2135,6 +2149,10 @@ Return nil."
2135 ((zerop delta)) 2149 ((zerop delta))
2136 ((window-size-fixed-p nil horizontal) 2150 ((window-size-fixed-p nil horizontal)
2137 (error "Selected window has fixed size")) 2151 (error "Selected window has fixed size"))
2152 ((window-minibuffer-p)
2153 (if horizontal
2154 (error "Cannot resize minibuffer window horizontally")
2155 (window--resize-mini-window (selected-window) (- delta))))
2138 ((window--resizable-p nil (- delta) horizontal) 2156 ((window--resizable-p nil (- delta) horizontal)
2139 (window-resize nil (- delta) horizontal)) 2157 (window-resize nil (- delta) horizontal))
2140 (t 2158 (t