From 811dc814a055ee9aee0b349ebf9124e8f573bab1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 18 Oct 2024 11:09:29 +0530 Subject: [PATCH] Rename variable with better name This is the time at which the cursor was moved by the client not the time at which it was updated. --- kitty/cursor_trail.c | 2 +- kitty/data-types.h | 2 +- kitty/screen.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kitty/cursor_trail.c b/kitty/cursor_trail.c index 47cba8fbf..52217eea4 100644 --- a/kitty/cursor_trail.c +++ b/kitty/cursor_trail.c @@ -56,7 +56,7 @@ update_cursor_trail(CursorTrail *ct, Window *w, monotonic_t now, OSWindow *os_wi ct->corner_y[i] = EDGE(y, ci[i][1]); } } - else if (OPT(cursor_trail) < now - WD.screen->cursor->updated_at && ct->updated_at < now) { + else if (OPT(cursor_trail) < now - WD.screen->cursor->position_changed_by_client_at && ct->updated_at < now) { float cursor_center_x = (EDGE(x, 0) + EDGE(x, 1)) * 0.5f; float cursor_center_y = (EDGE(y, 0) + EDGE(y, 1)) * 0.5f; float cursor_diag_2 = norm(EDGE(x, 1) - EDGE(x, 0), EDGE(y, 1) - EDGE(y, 0)) * 0.5f; diff --git a/kitty/data-types.h b/kitty/data-types.h index 8ec97ab92..807c3866e 100644 --- a/kitty/data-types.h +++ b/kitty/data-types.h @@ -297,7 +297,7 @@ typedef struct { PyObject_HEAD bool bold, italic, reverse, strikethrough, dim, non_blinking; - monotonic_t updated_at; + monotonic_t position_changed_by_client_at; unsigned int x, y; uint8_t decoration; CursorShape shape; diff --git a/kitty/screen.c b/kitty/screen.c index cec584db1..da325a504 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -1765,7 +1765,7 @@ screen_cursor_position(Screen *self, unsigned int line, unsigned int column) { line += self->margin_top; line = MAX(self->margin_top, MIN(line, self->margin_bottom)); } - self->cursor->updated_at = monotonic(); + self->cursor->position_changed_by_client_at = monotonic(); self->cursor->x = column; self->cursor->y = line; screen_ensure_bounds(self, false, in_margins); }