From 0299cda7a9f4bfd54918fd2806626baba3de0c37 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 23 Oct 2013 19:07:17 +0200 Subject: [PATCH] screen: remove old cursor-drawing fallback We used to not guarantee that all cells are allocated. Hence, we had to correctly draw the cursor if they weren't. These days we have this guarantee, though. So remove the old fallbacks. Signed-off-by: David Herrmann --- src/tsm_screen.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/tsm_screen.c b/src/tsm_screen.c index 5a48b78..a23b28d 100644 --- a/src/tsm_screen.c +++ b/src/tsm_screen.c @@ -2005,7 +2005,6 @@ tsm_age_t tsm_screen_draw(struct tsm_screen *con, tsm_screen_draw_cb draw_cb, struct line *iter, *line = NULL; struct cell *cell; struct tsm_screen_attr attr; - bool cursor_done = false; int ret, warned = 0; const uint32_t *ch; size_t len; @@ -2085,12 +2084,9 @@ tsm_age_t tsm_screen_draw(struct tsm_screen *con, tsm_screen_draw_cb draw_cb, } } - if (k == cur_y + 1 && - j == cur_x) { - cursor_done = true; - if (!(con->flags & TSM_SCREEN_HIDE_CURSOR)) - attr.inverse = !attr.inverse; - } + if (k == cur_y + 1 && j == cur_x && + !(con->flags & TSM_SCREEN_HIDE_CURSOR)) + attr.inverse = !attr.inverse; /* TODO: do some more sophisticated inverse here. When * INVERSE mode is set, we should instead just select @@ -2128,16 +2124,6 @@ tsm_age_t tsm_screen_draw(struct tsm_screen *con, tsm_screen_draw_cb draw_cb, "suppressing further warnings during this rendering round"); } } - - if (k == cur_y + 1 && !cursor_done) { - cursor_done = true; - if (!(con->flags & TSM_SCREEN_HIDE_CURSOR)) { - if (!(con->flags & TSM_SCREEN_INVERSE)) - attr.inverse = !attr.inverse; - draw_cb(con, 0, NULL, 0, 1, - cur_x, i, &attr, 0, data); - } - } } if (con->age_reset) { -- 2.7.4