aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-17 15:32:57 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-17 15:32:57 +0000
commit29c781b8325c8f4f029f46eb778e5d72c1d41cc0 (patch)
tree4f907641ee41dd08a581145c6186698da6a0368b
parentrender: don't try to resize if we're shutting down (diff)
term: ptmx: don't set 'pending' flag when app sync updates are in use
-rw-r--r--terminal.c72
1 files changed, 34 insertions, 38 deletions
diff --git a/terminal.c b/terminal.c
index bd55c41a..244ef83d 100644
--- a/terminal.c
+++ b/terminal.c
@@ -172,41 +172,37 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data)
vt_from_slave(term, buf, count);
}
- /*
- * We likely need to re-render. But, we don't want to do it
- * immediately. Often, a single client update is done through
- * multiple writes. This could lead to us rendering one frame with
- * "intermediate" state.
- *
- * For example, we might end up rendering a frame
- * where the client just erased a line, while in the
- * next frame, the client wrote to the same line. This
- * causes screen "flickering".
- *
- * Mitigate by always incuring a small delay before
- * rendering the next frame. This gives the client
- * some time to finish the operation (and thus gives
- * us time to receive the last writes before doing any
- * actual rendering).
- *
- * We incur this delay *every* time we receive
- * input. To ensure we don't delay rendering
- * indefinitely, we start a second timer that is only
- * reset when we render.
- *
- * Note that when the client is producing data at a
- * very high pace, we're rate limited by the wayland
- * compositor anyway. The delay we introduce here only
- * has any effect when the renderer is idle.
- */
- if (term->window->frame_callback == NULL) {
- if (term->render.app_sync_updates.enabled ||
- term->render.app_sync_updates.flipped)
- {
- ;
- }
-
- else {
+ if (!term->render.app_sync_updates.enabled &&
+ !term->render.app_sync_updates.flipped)
+ {
+ /*
+ * We likely need to re-render. But, we don't want to do it
+ * immediately. Often, a single client update is done through
+ * multiple writes. This could lead to us rendering one frame with
+ * "intermediate" state.
+ *
+ * For example, we might end up rendering a frame
+ * where the client just erased a line, while in the
+ * next frame, the client wrote to the same line. This
+ * causes screen "flickering".
+ *
+ * Mitigate by always incuring a small delay before
+ * rendering the next frame. This gives the client
+ * some time to finish the operation (and thus gives
+ * us time to receive the last writes before doing any
+ * actual rendering).
+ *
+ * We incur this delay *every* time we receive
+ * input. To ensure we don't delay rendering
+ * indefinitely, we start a second timer that is only
+ * reset when we render.
+ *
+ * Note that when the client is producing data at a
+ * very high pace, we're rate limited by the wayland
+ * compositor anyway. The delay we introduce here only
+ * has any effect when the renderer is idle.
+ */
+ if (term->window->frame_callback == NULL) {
/* First timeout - reset each time we receive input. */
#if PTMX_TIMING
@@ -238,9 +234,9 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data)
NULL);
term->delayed_render_timer.is_armed = true;
}
- }
- } else
- term->render.pending.grid = true;
+ } else
+ term->render.pending.grid = true;
+ }
if (hup) {
if (term->hold_at_exit) {