From: Martin Rudalics Date: Wed, 7 Oct 2015 09:11:53 +0000 (+0200) Subject: In resize_frame_windows don't set a top position when resizing horizontally. X-Git-Tag: emacs-25.0.90~1206 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=391291f4b18b4a1370840de4869797a514a900ae;p=emacs.git In resize_frame_windows don't set a top position when resizing horizontally. * src/window.c (resize_frame_windows): Don't set root window's top position when resizing horizontally. --- diff --git a/src/window.c b/src/window.c index 6d06e548094..3566f6e6469 100644 --- a/src/window.c +++ b/src/window.c @@ -3971,7 +3971,6 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) /* old_size is the old size of the frame's root window. */ int old_size = horflag ? r->total_cols : r->total_lines; int old_pixel_size = horflag ? r->pixel_width : r->pixel_height; - int old_pixel_top = r->pixel_top; /* new_size is the new size of the frame's root window. */ int new_size, new_pixel_size; int unit = horflag ? FRAME_COLUMN_WIDTH (f) : FRAME_LINE_HEIGHT (f); @@ -4001,11 +4000,8 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) new_pixel_size = new_size * unit; } - r->top_line = FRAME_TOP_MARGIN (f); - r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f); - if (new_pixel_size == old_pixel_size - && r->pixel_top == old_pixel_top) + && (horflag || r->pixel_top == FRAME_TOP_MARGIN_HEIGHT (f))) ; else if (WINDOW_LEAF_P (r)) /* For a leaf root window just set the size. */ @@ -4016,6 +4012,9 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) } else { + r->top_line = FRAME_TOP_MARGIN (f); + r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f); + r->total_lines = new_size; r->pixel_height = new_pixel_size; } @@ -4023,6 +4022,12 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) { Lisp_Object delta; + if (!horflag) + { + r->top_line = FRAME_TOP_MARGIN (f); + r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f); + } + if (pixelwise) XSETINT (delta, new_pixel_size - old_pixel_size); else