# HG changeset patch # User Mike Sperber # Date 1209220124 -7200 # Node ID c32b3d10c56b202091a1abe4ad924db6535e847b # Parent 1d41b9bcf74f7ed4ab6e296322a182fe580a95a2 Fix problem with `resize-minibuffer-mode'. 2008-04-26 Mike Sperber * 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. diff -r 1d41b9bcf74f -r c32b3d10c56b src/ChangeLog --- 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 + + * 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 * depend: diff -r 1d41b9bcf74f -r c32b3d10c56b src/window.c --- 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);