changeset 4446:c32b3d10c56b

Fix problem with `resize-minibuffer-mode'. 2008-04-26 Mike Sperber <mike@xemacs.org> * window.c (set_window_pixsize): Round up when we're shrinking, down when we're growing * to make sure that pairs of grow / shrink meant to * cancel out actually do cancel out. This fixes a problem with `resize-minibuffer-mode' where successive grow/shrink actions are meant to cancel out, but previously didn't.
author Mike Sperber <sperber@deinprogramm.de>
date Sat, 26 Apr 2008 16:28:44 +0200
parents 1d41b9bcf74f
children 15dd5229cea5 4953b7353349
files src/ChangeLog src/window.c
diffstat 2 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Apr 13 11:18:00 2008 +0200
+++ b/src/ChangeLog	Sat Apr 26 16:28:44 2008 +0200
@@ -1,3 +1,11 @@
+2008-04-26  Mike Sperber  <mike@xemacs.org>
+
+	* window.c (set_window_pixsize): Round up when we're shrinking,
+	down when we're growing * to make sure that pairs of grow / shrink
+	meant to * cancel out actually do cancel out.  This fixes a
+	problem with `resize-minibuffer-mode' where successive grow/shrink
+	actions are meant to cancel out, but previously didn't.
+
 2008-04-05  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* depend: 
--- a/src/window.c	Sun Apr 13 11:18:00 2008 +0200
+++ b/src/window.c	Sat Apr 26 16:28:44 2008 +0200
@@ -3601,7 +3601,17 @@
 	  /* All but the last window should have a height which is
              a multiple of the default line height. */
 	  if (!NILP (c->next))
-	    pos = (pos / line_size) * line_size;
+	    {
+	      /*
+	       * Round up when we're shrinking, down when we're growing
+	       * to make sure that pairs of grow / shrink meant to
+	       * cancel out actually do cancel out.
+	       */
+	      if (pixel_adj_left < 0)
+		pos = ((pos + line_size -1) / line_size) * line_size;
+	      else
+		pos = (pos / line_size) * line_size;
+	    }
 
 	  /* Avoid confusion: don't delete child if it becomes too small */
 	  set_window_pixsize (child, pos + first - last_pos, 1, set_height);