aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-11 07:06:36 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-11 07:06:36 +0000
commit12a1688ce3c1b1e105917d95f5ba7c70c618dfcd (patch)
tree5cd88f721c4ef32443e42ac863661792888358e2 /render.c
parentterm: remove term_has_kbd_focus(), use term->kbd_focus instead (diff)
render: use kbd-focus instead of visual focus for hollow block cursor
When determining whether we should render a hollow block cursor, i.e. to signal that we're unfocused, base the decision on the terminals current keyboard focus, not visual focus.
Diffstat (limited to 'render.c')
-rw-r--r--render.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/render.c b/render.c
index 670b9282..7f4596b0 100644
--- a/render.c
+++ b/render.c
@@ -328,7 +328,7 @@ draw_cursor(const struct terminal *term, const struct cell *cell,
switch (term->cursor_style) {
case CURSOR_BLOCK:
- if (!term->visual_focus)
+ if (!term->kbd_focus)
draw_unfocused_block(term, pix, &cursor_color, x, y, cols);
else if (term->cursor_blink.state == CURSOR_BLINK_ON) {
@@ -340,12 +340,12 @@ draw_cursor(const struct terminal *term, const struct cell *cell,
break;
case CURSOR_BAR:
- if (term->cursor_blink.state == CURSOR_BLINK_ON || !term->visual_focus)
+ if (term->cursor_blink.state == CURSOR_BLINK_ON || !term->kbd_focus)
draw_bar(term, pix, font, &cursor_color, x, y);
break;
case CURSOR_UNDERLINE:
- if (term->cursor_blink.state == CURSOR_BLINK_ON || !term->visual_focus) {
+ if (term->cursor_blink.state == CURSOR_BLINK_ON || !term->kbd_focus) {
draw_underline(
term, pix, attrs_to_font(term, &cell->attrs), &cursor_color,
x, y, cols);
@@ -435,7 +435,7 @@ render_cell(struct terminal *term, pixman_image_t *pix,
if (cell->attrs.blink)
term_arm_blink_timer(term);
- if (has_cursor && term->cursor_style == CURSOR_BLOCK && term->visual_focus)
+ if (has_cursor && term->cursor_style == CURSOR_BLOCK && term->kbd_focus)
draw_cursor(term, cell, font, pix, &fg, &bg, x, y, cell_cols);
if (cell->wc == 0 || cell->attrs.conceal)
@@ -495,7 +495,7 @@ render_cell(struct terminal *term, pixman_image_t *pix,
}
draw_cursor:
- if (has_cursor && (term->cursor_style != CURSOR_BLOCK || !term->visual_focus))
+ if (has_cursor && (term->cursor_style != CURSOR_BLOCK || !term->kbd_focus))
draw_cursor(term, cell, font, pix, &fg, &bg, x, y, cell_cols);
pixman_image_set_clip_region32(pix, NULL);