From 4ecb0ecf4d1f45df918a8dd2dbabd6e9d7090dcc Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 2 Jan 2020 15:58:52 +0100 Subject: wayland: rename focused/moused to kbd_focus/mouse_focus --- render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'render.c') diff --git a/render.c b/render.c index 97284cbb..d02ada3e 100644 --- a/render.c +++ b/render.c @@ -279,7 +279,7 @@ draw_cursor(const struct terminal *term, const struct cell *cell, pixman_image_t *pix, pixman_color_t *fg, const pixman_color_t *bg, int x, int y, int cols) { - bool have_focus = term->wl->focused == term; + bool have_focus = term->wl->kbd_focus == term; pixman_color_t cursor_color; pixman_color_t text_color; -- cgit v1.3 From 29483f936f664a17fcf36f55350970dd3891fd10 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 2 Jan 2020 19:37:21 +0100 Subject: render: draw_cursor: use terminal's visual focus to determine cursor shape --- render.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index d02ada3e..addb8d7a 100644 --- a/render.c +++ b/render.c @@ -279,8 +279,6 @@ draw_cursor(const struct terminal *term, const struct cell *cell, pixman_image_t *pix, pixman_color_t *fg, const pixman_color_t *bg, int x, int y, int cols) { - bool have_focus = term->wl->kbd_focus == term; - pixman_color_t cursor_color; pixman_color_t text_color; @@ -307,7 +305,7 @@ draw_cursor(const struct terminal *term, const struct cell *cell, switch (term->cursor_style) { case CURSOR_BLOCK: - if (!have_focus) + if (!term->visual_focus) draw_unfocused_block(term, pix, &cursor_color, x, y, cols); else if (term->cursor_blink.state == CURSOR_BLINK_ON) { @@ -319,12 +317,12 @@ draw_cursor(const struct terminal *term, const struct cell *cell, break; case CURSOR_BAR: - if (term->cursor_blink.state == CURSOR_BLINK_ON || !have_focus) + if (term->cursor_blink.state == CURSOR_BLINK_ON || !term->visual_focus) draw_bar(term, pix, font, &cursor_color, x, y); break; case CURSOR_UNDERLINE: - if (term->cursor_blink.state == CURSOR_BLINK_ON || !have_focus) { + if (term->cursor_blink.state == CURSOR_BLINK_ON || !term->visual_focus) { draw_underline( term, pix, attrs_to_font(term, &cell->attrs), &cursor_color, x, y, cols); -- cgit v1.3 From af26f043fb507c6aa4b6d7cf5dea39f3b9d3b234 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 3 Jan 2020 12:44:29 +0100 Subject: render: resize() now only calls refresh() if asked to --- render.c | 5 +++-- render.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index 47017ea4..139bedb9 100644 --- a/render.c +++ b/render.c @@ -960,7 +960,7 @@ reflow(struct row **new_grid, int new_cols, int new_rows, /* Move to terminal.c? */ void -render_resize(struct terminal *term, int width, int height) +render_resize(struct terminal *term, int width, int height, bool refresh) { int scale = -1; tll_foreach(term->window->on_outputs, it) { @@ -1083,7 +1083,8 @@ render_resize(struct terminal *term, int width, int height) term->render.last_cursor.cell = NULL; term_damage_view(term); - render_refresh(term); + if (refresh) + render_refresh(term); } void diff --git a/render.h b/render.h index ad6b6578..e3253074 100644 --- a/render.h +++ b/render.h @@ -6,7 +6,7 @@ struct font *attrs_to_font( const struct terminal *term, const struct attributes *attrs); void grid_render(struct terminal *term); -void render_resize(struct terminal *term, int width, int height); +void render_resize(struct terminal *term, int width, int height, bool refresh); void render_set_title(struct terminal *term, const char *title); void render_refresh(struct terminal *term); -- cgit v1.3