aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-03 11:49:51 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-03 11:49:51 +0000
commit43b76f002f997b242fedbab8da19d7ddb4d560cf (patch)
treeb0996afcaab9109a6153042f11331a859fb9bcbd /render.c
parentrender: use a unique buffer cookie for the 'search' surface (diff)
parentwayland: debug log state changes in xdg-toplevel-configure (diff)
Merge branch 'visual-focus'
Diffstat (limited to 'render.c')
-rw-r--r--render.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/render.c b/render.c
index 137e98b4..139bedb9 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->focused == 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);
@@ -962,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) {
@@ -1085,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