emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 35f9e0f: Fix flicker when setting hscroll of xwidget


From: Lars Ingebrigtsen
Subject: master 35f9e0f: Fix flicker when setting hscroll of xwidget
Date: Mon, 8 Nov 2021 23:07:12 -0500 (EST)

branch: master
commit 35f9e0f46975c35ffec494a46dedf03304ca9da1
Author: Po Lu <luangruo@yahoo.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix flicker when setting hscroll of xwidget
    
    * src/xterm.c (x_scroll_run): Use original height of xwidget instead
    of window height and set cairo surface size (bug#51697).
---
 src/xterm.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 1fb3d8d..172abe9 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4408,7 +4408,7 @@ x_scroll_run (struct window *w, struct run *run)
          Window child = children[i];
          struct xwidget_view *view = xwidget_view_from_window (child);
 
-         if (view)
+         if (view && !view->hidden)
            {
              int window_y = view->y + view->clip_top;
              int window_height = view->clip_bottom - view->clip_top;
@@ -4445,16 +4445,14 @@ x_scroll_run (struct window *w, struct run *run)
                  view->y = y;
 
                  clip_top = 0;
-                 clip_bottom = window_height;
+                 clip_bottom = XXWIDGET (view->model)->height;
 
                  if (y < text_area_y)
                    clip_top = text_area_y - y;
 
-                 if ((y + clip_top + window_height)
-                     > (text_area_y + text_area_height))
+                 if ((y + clip_bottom) > (text_area_y + text_area_height))
                    {
-                     clip_bottom -= (y + clip_top + window_height)
-                       - (text_area_y + text_area_height);
+                     clip_bottom -= (y + clip_bottom) - (text_area_y + 
text_area_height);
                    }
 
                  view->clip_top = clip_top;
@@ -4468,10 +4466,16 @@ x_scroll_run (struct window *w, struct run *run)
                      XUnmapWindow (dpy, child);
                    }
                  else
-                   XMoveResizeWindow (dpy, child, view->x + view->clip_left,
-                                      view->y + view->clip_top,
-                                      view->clip_right - view->clip_left,
-                                      view->clip_bottom - view->clip_top);
+                   {
+                     XMoveResizeWindow (dpy, child, view->x + view->clip_left,
+                                        view->y + view->clip_top,
+                                        view->clip_right - view->clip_left,
+                                        view->clip_bottom - view->clip_top);
+                     cairo_xlib_surface_set_size (view->cr_surface,
+                                                  view->clip_right - 
view->clip_left,
+                                                  view->clip_bottom - 
view->clip_top);
+                   }
+                 xwidget_expose (view);
                  XFlush (dpy);
                }
             }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]