diff --git a/kitty/cursor_trail.c b/kitty/cursor_trail.c index fb4c4fbd9..3127b3ed5 100644 --- a/kitty/cursor_trail.c +++ b/kitty/cursor_trail.c @@ -45,6 +45,7 @@ update_cursor_trail_target(CursorTrail *ct, Window *w) { EDGE(x, 1) = right; EDGE(y, 0) = top; EDGE(y, 1) = bottom; + ct->screen = WD.screen; } } @@ -119,13 +120,9 @@ update_cursor_trail(CursorTrail *ct, Window *w, monotonic_t now, OSWindow *os_wi ct->needs_render = true; } - if (ct->needs_render) { - ColorProfile *cp = WD.screen->color_profile; - ct->color = colorprofile_to_color(cp, cp->overridden.cursor_color, cp->configured.cursor_color).rgb; - } - -#undef WD -#undef EDGE // returning true here will cause the cells to be drawn return ct->needs_render || needs_render_prev; } + +#undef WD +#undef EDGE diff --git a/kitty/shaders.c b/kitty/shaders.c index 38a5cc3ab..a44cb4b86 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -1154,7 +1154,9 @@ draw_cursor_trail(CursorTrail *trail) { glUniform2fv(trail_program_layout.uniforms.cursor_edge_x, 1, trail->cursor_edge_x); glUniform2fv(trail_program_layout.uniforms.cursor_edge_y, 1, trail->cursor_edge_y); - color_vec3(trail_program_layout.uniforms.trail_color, trail->color); + ColorProfile *cp = trail->screen->color_profile; + color_type color = colorprofile_to_color(cp, cp->overridden.cursor_color, cp->configured.cursor_color).rgb; + color_vec3(trail_program_layout.uniforms.trail_color, color); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); diff --git a/kitty/state.h b/kitty/state.h index 08a592001..a121073c7 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -218,7 +218,7 @@ typedef struct { typedef struct { bool needs_render; monotonic_t updated_at; - color_type color; + Screen* screen; float corner_x[4]; float corner_y[4]; float cursor_edge_x[2];