Subject: 29.0.50; [PATCH] Fix flicker when setting hscroll of xwidget

From: Po Lu <[email-masked]>
Date: Tue, 09 Nov 2021 09:41:10 +0800

Thanks.

>From a898413fcf34b045ecc8c4dfa312f767e1bbc12a Mon Sep 17 00:00:00 2001
From: Po Lu <[email-masked]>
Date: Tue, 9 Nov 2021 09:40:09 +0800
Subject: [PATCH] Fix flicker when setting hscroll of xwidget

* src/xterm.c (x_scroll_run): Use original height of xwidget instead
of window height.
---
 src/xterm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 1fb3d8d7c0..38122d8534 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4445,15 +4445,15 @@ x_scroll_run (struct window *w, struct run *run)
 		  view->y = y;
 
 		  clip_top = 0;
-		  clip_bottom = window_height;
+		  clip_bottom = view->clip_bottom + view->clip_top;
 
 		  if (y < text_area_y)
 		    clip_top = text_area_y - y;
 
-		  if ((y + clip_top + window_height)
+		  if ((y + clip_top + clip_bottom)
 		      > (text_area_y + text_area_height))
 		    {
-		      clip_bottom -= (y + clip_top + window_height)
+		      clip_bottom -= (y + clip_top + clip_bottom)
 			- (text_area_y + text_area_height);
 		    }
 
-- 
2.31.1