diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-09-29 08:05:52 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-09-29 08:05:52 +0000 |
| commit | edb904a1877324ae4977c8a38596487518c9e1a8 (patch) | |
| tree | e35e449476827a375bb4bfd12e563190e9d76da3 | |
| parent | render: term->render.margins is used to explicitly tell us to re-render margins (diff) | |
osc: don’t explicitly call render_refresh() when changing the color palette
Doing so will schedule the renderer “as soon as possible”. I.e we’re
by-passing the regular scheduler, and thus we’re by-passing the user’s
setting of the delayed-render-* timers.
The fact that we’re scheduling “as soon as possible” also means we’re
much more likely to trigger flickering, or color flashes, if the
application is changing colors which are on the screen.
To handle changes to the cursor color(s), use the new
term_damage_cursor() instead of render_refresh().
To handle background color changes, which affect the margins, use the
new term_damage_margins() instead of render_refresh_margins(),
Closes #141
| -rw-r--r-- | osc.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -589,7 +589,6 @@ osc_dispatch(struct terminal *term) } } - render_refresh(term); break; } @@ -635,8 +634,7 @@ osc_dispatch(struct terminal *term) } term_damage_view(term); - render_refresh(term); - render_refresh_margins(term); + term_damage_margins(term); break; } @@ -664,7 +662,8 @@ osc_dispatch(struct terminal *term) term->cursor_color.cursor = 0; /* Invert fg/bg */ else term->cursor_color.cursor = 1u << 31 | color; - render_refresh(term); + + term_damage_cursor(term); break; case 30: /* Set tab title */ @@ -705,7 +704,6 @@ osc_dispatch(struct terminal *term) } } - render_refresh(term); break; } @@ -716,22 +714,20 @@ osc_dispatch(struct terminal *term) LOG_DBG("resetting foreground"); term->colors.fg = term->colors.default_fg; term_damage_view(term); - render_refresh(term); break; case 111: /* Reset default text background color */ LOG_DBG("resetting background"); term->colors.bg = term->colors.default_bg; term_damage_view(term); - render_refresh(term); - render_refresh_margins(term); + term_damage_margins(term); break; case 112: LOG_DBG("resetting cursor color"); term->cursor_color.text = term->default_cursor_color.text; term->cursor_color.cursor = term->default_cursor_color.cursor; - render_refresh(term); + term_damage_cursor(term); break; case 555: |
