]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer XMoveResizeWindow to XMoveWindow for resizing xwidgets
authorPo Lu <luangruo@yahoo.com>
Wed, 3 Nov 2021 12:00:57 +0000 (20:00 +0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 7 Nov 2021 01:59:40 +0000 (02:59 +0100)
* src/xwidget.c (x_draw_xwidget_glyph_string): Prefer
XMoveResizeWindow to avoid extra expose events.

src/xwidget.c

index b25f95c7fafef267d34411109e4c46070131cd85..d4196bced1ac2b937304a348d8c71937dc820a85 100644 (file)
@@ -868,7 +868,11 @@ x_draw_xwidget_glyph_string (struct glyph_string *s)
   if (moved)
     {
 #ifdef USE_GTK
-      XMoveWindow (xv->dpy, xv->wdesc, x + clip_left, y + clip_top);
+      XMoveResizeWindow (xv->dpy, xv->wdesc, x + clip_left, y + clip_top,
+                        clip_right - clip_left, clip_bottom - clip_top);
+      XFlush (xv->dpy);
+      cairo_xlib_surface_set_size (xv->cr_surface, clip_right - clip_left,
+                                  clip_bottom - clip_top);
 #elif defined NS_IMPL_COCOA
       nsxwidget_move_view (xv, x + clip_left, y + clip_top);
 #endif
@@ -884,7 +888,7 @@ x_draw_xwidget_glyph_string (struct glyph_string *s)
       || xv->clip_top != clip_top || xv->clip_left != clip_left)
     {
 #ifdef USE_GTK
-      if (!wdesc_was_none)
+      if (!wdesc_was_none && !moved)
        {
          XResizeWindow (xv->dpy, xv->wdesc, clip_right - clip_left,
                         clip_bottom - clip_top);