Skip to content

Instantly share code, notes, and snippets.

@saitoha
Created August 14, 2014 16:26
Show Gist options
  • Save saitoha/6fb960b49b4d453b6eb2 to your computer and use it in GitHub Desktop.
Save saitoha/6fb960b49b4d453b6eb2 to your computer and use it in GitHub Desktop.
xterm: fix for filcker problem with animated SIXEL graphics (http://youtu.be/_kUzRHVllJg)
--- xterm-310/graphics.c 2014-07-13 10:19:45.000000000 +0900
+++ xterm-310/graphics.c 2014-08-15 01:20:53.000000000 +0900
@@ -847,6 +847,7 @@
XGCValues xgcv;
XtGCMask mask;
int holes, total;
+ Pixmap pixmap;
TRACE(("refreshing graphic from %d,%d %dx%d (valid=%d, size=%dx%d, scale=%dx%d max=%dx%d) at base=%d,%d\n",
x, y, w, h,
@@ -864,6 +865,10 @@
xgcv.graphics_exposures = False;
mask = GCForeground | GCGraphicsExposures;
graphics_gc = XCreateGC(display, vwindow, mask, &xgcv);
+ pixmap = XCreatePixmap(display, vwindow,
+ graphic->actual_width,
+ graphic->actual_height,
+ XDefaultDepth(display, DefaultScreen(display)));
pw = graphic->pixw;
ph = graphic->pixh;
@@ -913,14 +918,20 @@
old_fg = color;
}
- XFillRectangle(display, vwindow, graphics_gc,
- xbase + ctest,
- ybase + rtest,
+ XFillRectangle(display, pixmap, graphics_gc,
+ ctest,
+ rtest,
(unsigned) pw,
(unsigned) ph);
}
}
+ XCopyArea(display, pixmap, vwindow, graphics_gc,
+ 0, 0,
+ graphic->actual_width, graphic->actual_height,
+ xbase, ybase);
+ XFreePixmap(display, pixmap);
+
#ifdef DEBUG_REFRESH
{
XColor def;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment