Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |From 1892290c3b0ef064083c8af4e4bec443a36ca5c8 Mon Sep 17 00:00:00 2001 |From: "Avi Halachmi (:avih)" |Date: Tue, 26 Feb 2019 22:37:49 +0200 |Subject: [PATCH] auto-sync: draw on idle to avoid flicker/tearing | |st could easily tear/flicker with animation or other unattended |output. This commit eliminates most of the tear/flicker. | |Before this commit, the display timing had two "modes": | |- Interactively, st was waiting fixed `1000/xfps` ms after forwarding | the kb/mouse event to the application and before drawing. | |- Unattended, and specifically with animations, the draw frequency was | throttled to `actionfps`. Animation at a higher rate would throttle | and likely tear, and at lower rates it was tearing big frames | (specifically, when one `read` didn't get a full "frame"). | |The interactive behavior was decent, but it was impossible to get good |unattended-draw behavior even with carefully chosen configuration. | |This commit changes the behavior such that it draws on idle instead of |using fixed latency/frequency. This means that it tries to draw only |when it's very likely that the application has completed its output |(or after some duration without idle), so it mostly succeeds to avoid |tear, flicker, and partial drawing. | |The config values minlatency/maxlatency replace xfps/actionfps and |define the range which the algorithm is allowed to wait from the |initial draw-trigger until the actual draw. The range enables the |flexibility to choose when to draw - when least likely to flicker. | |It also unifies the interactive and unattended behavior and config |values, which makes the code simpler as well - without sacrificing |latency during interactive use, because typically interactively idle |arrives very quickly, so the wait is typically minlatency. | |While it only slighly improves interactive behavior, for animations |and other unattended-drawing it improves greatly, as it effectively |adapts to any [animation] output rate without tearing, throttling, |redundant drawing, or unnecessary delays (sounds impossible, but it |works). |--- | config.def.h | 11 +++-- | x.c | 120 ++++++++++++++++++++++++--------------------------- | 2 files changed, 65 insertions(+), 66 deletions(-) | |diff --git a/config.def.h b/config.def.h |index 0895a1f..fdbacfd 100644 |--- a/config.def.h |+++ b/config.def.h -------------------------- Patching file config.def.h using Plan A... Hunk #1 succeeded at 43. Hmm... The next patch looks like a unified diff to me... The text leading up to this was: -------------------------- |diff --git a/x.c b/x.c |index e5f1737..cbbd11f 100644 |--- a/x.c |+++ b/x.c -------------------------- Patching file x.c using Plan A... Hunk #1 succeeded at 1867. Hunk #2 succeeded at 1890. Hmm... Ignoring the trailing garbage. done