diff options
| -rw-r--r-- | commands.c | 6 | ||||
| -rw-r--r-- | main.c | 9 | ||||
| -rw-r--r-- | render.c | 10 | ||||
| -rw-r--r-- | render.h | 1 | ||||
| -rw-r--r-- | selection.c | 6 |
5 files changed, 16 insertions, 16 deletions
@@ -62,8 +62,7 @@ cmd_scrollback_up(struct terminal *term, int rows) term->grid->view = new_view; term_damage_view(term); - if (term->frame_callback == NULL) - grid_render(term); + render_refresh(term); } void @@ -122,6 +121,5 @@ cmd_scrollback_down(struct terminal *term, int rows) term->grid->view = new_view; term_damage_view(term); - if (term->frame_callback == NULL) - grid_render(term); + render_refresh(term); } @@ -716,8 +716,7 @@ main(int argc, char *const *argv) if (ret == 0 || (timeout_ms != -1 && !(fds[1].revents & POLLIN))) { /* Delayed rendering */ - if (term.frame_callback == NULL) - grid_render(&term); + render_refresh(&term); } /* Reset poll timeout to infinity */ @@ -809,8 +808,7 @@ main(int argc, char *const *argv) term.flash.active = false; term_damage_view(&term); - if (term.frame_callback == NULL) - grid_render(&term); + render_refresh(&term); } if (fds[4].revents & POLLIN) { @@ -838,8 +836,7 @@ main(int argc, char *const *argv) } } - if (term.frame_callback == NULL) - grid_render(&term); + render_refresh(&term); } } @@ -715,8 +715,7 @@ render_resize(struct terminal *term, int width, int height) term_damage_all(term); term_damage_view(term); - if (term->frame_callback == NULL) - grid_render(term); + render_refresh(term); } void @@ -751,3 +750,10 @@ render_update_cursor_surface(struct terminal *term) wl_surface_commit(term->wl.pointer.surface); } + +void +render_refresh(struct terminal *term) +{ + if (term->frame_callback == NULL) + grid_render(term); +} @@ -9,3 +9,4 @@ void grid_render(struct terminal *term); void render_resize(struct terminal *term, int width, int height); void render_set_title(struct terminal *term, const char *title); void render_update_cursor_surface(struct terminal *term); +void render_refresh(struct terminal *term); diff --git a/selection.c b/selection.c index 6f7c015e..468d400a 100644 --- a/selection.c +++ b/selection.c @@ -131,8 +131,7 @@ selection_update(struct terminal *term, int col, int row) assert(term->selection.start.row != -1 && term->selection.end.row != -1); term_damage_rows_in_view(term, from - term->grid->view, to - term->grid->view); - if (term->frame_callback == NULL) - grid_render(term); + render_refresh(term); } static const struct zwp_primary_selection_source_v1_listener primary_selection_source_listener; @@ -210,8 +209,7 @@ selection_cancel(struct terminal *term) min(start_row, end_row) - term->grid->view, max(start_row, end_row) - term->grid->view); - if (term->frame_callback == NULL) - grid_render(term); + render_refresh(term); } } |
