From 5116e40581ad5f2a326e3022a1f148402cf26b4d Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 29 Sep 2020 10:03:00 +0200 Subject: term: add term_damage_cursor() and term_damage_margins() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit term_damage_cursor() damages the cell where the cursor is currently at. This can be used to ensure the cursor is re-drawn, if there aren’t any other pending updates. term_damage_margins() requests the margins be redrawn the next time we render the grid. --- terminal.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 12e93ce2..13339c3b 100644 --- a/terminal.h +++ b/terminal.h @@ -388,6 +388,8 @@ struct terminal { bool title; } pending; + bool margins; /* Someone explicitly requested a refresh of the margins */ + int scrollback_lines; /* Number of scrollback lines, from conf (TODO: move out from render struct?) */ struct { @@ -512,6 +514,9 @@ void term_damage_rows_in_view(struct terminal *term, int start, int end); void term_damage_all(struct terminal *term); void term_damage_view(struct terminal *term); +void term_damage_cursor(struct terminal *term); +void term_damage_margins(struct terminal *term); + void term_reset_view(struct terminal *term); void term_damage_scroll( -- cgit v1.3 From 7ffd31e13a8834938550222d8b6078c4b98616f8 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 29 Sep 2020 10:08:59 +0200 Subject: render: remove render_refresh_margins() --- render.c | 6 ------ render.h | 1 - terminal.h | 2 -- 3 files changed, 9 deletions(-) (limited to 'terminal.h') diff --git a/render.c b/render.c index 86f028f7..210eaf47 100644 --- a/render.c +++ b/render.c @@ -2385,12 +2385,6 @@ render_refresh(struct terminal *term) term->render.refresh.grid = true; } -void -render_refresh_margins(struct terminal *term) -{ - term->render.refresh.margins = true; -} - void render_refresh_csd(struct terminal *term) { diff --git a/render.h b/render.h index 3f8cf540..05c79322 100644 --- a/render.h +++ b/render.h @@ -13,7 +13,6 @@ bool render_resize(struct terminal *term, int width, int height); bool render_resize_force(struct terminal *term, int width, int height); void render_refresh(struct terminal *term); -void render_refresh_margins(struct terminal *term); void render_refresh_csd(struct terminal *term); void render_refresh_search(struct terminal *term); void render_refresh_title(struct terminal *term); diff --git a/terminal.h b/terminal.h index 13339c3b..60a4aba4 100644 --- a/terminal.h +++ b/terminal.h @@ -373,7 +373,6 @@ struct terminal { /* Scheduled for rendering, as soon-as-possible */ struct { bool grid; - bool margins; bool csd; bool search; bool title; @@ -382,7 +381,6 @@ struct terminal { /* Scheduled for rendering, in the next frame callback */ struct { bool grid; - bool margins; bool csd; bool search; bool title; -- cgit v1.3