summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2013-12-31 20:06:18 +0100
committerMartin Rudalics <rudalics@gmx.at>2013-12-31 20:06:18 +0100
commit91415fb1cd0f913be6e8a2409b0d9cdca4352f3f (patch)
treeda552fac4ba6ddeac436f5f74598ae81526da7ed
parenta2301006964e8e773b39e3f7142ceb5925e6f518 (diff)
downloademacs-91415fb1cd0f913be6e8a2409b0d9cdca4352f3f.tar.gz
Fix last change of grow_mini_window.
* window.c (grow_mini_window): Fix last change.
-rw-r--r--src/ChangeLog4
-rw-r--r--src/window.c16
2 files changed, 12 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a363ce331fa..93d84b26b9c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-31 Martin Rudalics <rudalics@gmx.at>
+
+ * window.c (grow_mini_window): Fix last change.
+
2013-12-31 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (windowDidResignKey:): Set mouse_moved to 0 (Bug#8421).
diff --git a/src/window.c b/src/window.c
index 1e3d70fd88d..de1e2d2c068 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4582,24 +4582,24 @@ grow_mini_window (struct window *w, int delta, bool pixelwise)
if (pixelwise)
{
- pixel_height = max (min (-XINT (height), INT_MAX - w->pixel_height),
- FRAME_LINE_HEIGHT (f));
+ pixel_height = min (-XINT (height), INT_MAX - w->pixel_height);
line_height = pixel_height / FRAME_LINE_HEIGHT (f);
}
else
{
- line_height = max (min (-XINT (height),
- ((INT_MAX - w->pixel_height)
- / FRAME_LINE_HEIGHT (f))),
- 1);
+ line_height = min (-XINT (height),
+ ((INT_MAX - w->pixel_height)
+ / FRAME_LINE_HEIGHT (f)));
pixel_height = line_height * FRAME_LINE_HEIGHT (f);
}
/* Grow the mini-window. */
w->pixel_top = r->pixel_top + r->pixel_height;
w->top_line = r->top_line + r->total_lines;
- w->pixel_height += pixel_height;
- w->total_lines += line_height;
+ /* Make sure the mini-window has always at least one line. */
+ w->pixel_height = max (w->pixel_height + pixel_height,
+ FRAME_LINE_HEIGHT (f));
+ w->total_lines = max (w->total_lines + line_height, 1);
/* Enforce full redisplay of the frame. */
/* FIXME: Shouldn't window--resize-root-window-vertically do it? */