From 2e6ffa28f4fc475c98cae79d0859e6312d01e126 Mon Sep 17 00:00:00 2001 From: veltza <106755522+veltza@users.noreply.github.com> Date: Wed, 8 Jun 2022 00:51:58 +0300 Subject: [PATCH] Fix flickering when sixel images are moving --- x.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/x.c b/x.c index ffd4033..09efdf4 100644 --- a/x.c +++ b/x.c @@ -2744,22 +2744,10 @@ xfinishdraw(void) { #if SIXEL_PATCH ImageList *im; - int x, y; - int n = 0; - int nlimit = 256; - XRectangle *rects = NULL; XGCValues gcvalues; GC gc; #endif // SIXEL_PATCH - #if !SINGLE_DRAWABLE_BUFFER_PATCH - XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w, - win.h, 0, 0); - #endif // SINGLE_DRAWABLE_BUFFER_PATCH - XSetForeground(xw.dpy, dc.gc, - dc.col[IS_SET(MODE_REVERSE)? - defaultfg : defaultbg].pixel); - #if SIXEL_PATCH for (im = term.images; im; im = im->next) { if (term.images == NULL) { @@ -2810,7 +2798,6 @@ xfinishdraw(void) im->pixels = NULL; } - n = 0; memset(&gcvalues, 0, sizeof(gcvalues)); gc = XCreateGC(xw.dpy, xw.win, 0, &gcvalues); @@ -2822,10 +2809,14 @@ xfinishdraw(void) XFreeGC(xw.dpy, gc); } - - free(rects); - drawregion(0, 0, term.col, term.row); #endif // SIXEL_PATCH + + #if !SINGLE_DRAWABLE_BUFFER_PATCH + XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w, win.h, 0, 0); + #endif // SINGLE_DRAWABLE_BUFFER_PATCH + XSetForeground(xw.dpy, dc.gc, + dc.col[IS_SET(MODE_REVERSE)? + defaultfg : defaultbg].pixel); } void