aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-23 19:15:04 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-23 19:15:04 +0000
commit7958f8b5efcadbb00f7a417f0c24c0c682b7a9dd (patch)
treec37a609233e9db75e9bdce600bb04c2ad16ae368 /render.c
parentrender: margins: caller explicitly asks for top/bottom margins (diff)
render: scroll: move comment to where it belongs
Diffstat (limited to 'render.c')
-rw-r--r--render.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/render.c b/render.c
index 2c0cbc47..34777c12 100644
--- a/render.c
+++ b/render.c
@@ -599,18 +599,6 @@ grid_render_scroll(struct terminal *term, struct buffer *buf,
did_shm_scroll = shm_scroll(
term->wl->shm, buf, dmg->scroll.lines * term->cell_height);
- /*
- * When SHM scrolling succeeded, the scrolled in area is made
- * up of newly allocated, zero-initialized memory. Thus we'll
- * need to both copy the bottom scrolling region, and
- * re-render the window margins.
- *
- * This is different from when we scroll with a simple
- * memmove, since in that case, the scrolling region and
- * margins are *copied*, and thus the original region+margin
- * remains in place.
- */
-
if (!did_shm_scroll)
LOG_DBG("fast scroll failed");
} else {
@@ -620,6 +608,16 @@ grid_render_scroll(struct terminal *term, struct buffer *buf,
dmb->scroll.region.start, scroll_region_lines, term->rows);
}
+ /*
+ * When SHM scrolling succeeded, the scrolled in area is made up
+ * of newly allocated, zero-initialized memory. Thus we'll need to
+ * both copy the bottom scrolling region, and re-render the window
+ * margins.
+ *
+ * This is different from when we scroll with a simple memmove,
+ * since in that case, the scrolling region and margins are
+ * *copied*, and thus the original region+margin remains in place.
+ */
if (did_shm_scroll) {
/* Restore bottom scrolling region */