mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-11 02:59:40 +02:00
disable cursor trail while live resize in progress
This commit is contained in:
@@ -751,7 +751,7 @@ prepare_to_render_os_window(OSWindow *os_window, monotonic_t now, unsigned int *
|
||||
WD.screen->cursor_render_info.is_focused = os_window->is_focused;
|
||||
set_os_window_title_from_window(w, os_window);
|
||||
*active_window_bg = window_bg;
|
||||
if (true && update_cursor_trail(&tab->cursor_trail, w, now)) needs_render = true;
|
||||
if (true && update_cursor_trail(&tab->cursor_trail, w, now, os_window)) needs_render = true;
|
||||
} else {
|
||||
if (WD.screen->cursor_render_info.render_even_when_unfocused) {
|
||||
if (collect_cursor_info(&WD.screen->cursor_render_info, w, now, os_window)) needs_render = true;
|
||||
|
||||
@@ -30,7 +30,7 @@ get_cursor_edge(float *left, float *right, float *top, float *bottom, Window *w)
|
||||
}
|
||||
|
||||
bool
|
||||
update_cursor_trail(CursorTrail *ct, Window *w, monotonic_t now) {
|
||||
update_cursor_trail(CursorTrail *ct, Window *w, monotonic_t now, OSWindow *os_window) {
|
||||
// the trail corners move towards the cursor corner at a speed proportional to their distance from the cursor corner.
|
||||
// equivalent to exponential ease out animation.
|
||||
|
||||
@@ -49,7 +49,14 @@ update_cursor_trail(CursorTrail *ct, Window *w, monotonic_t now) {
|
||||
// the decay time for the trail to reach 1/1024 of its distance from the cursor corner
|
||||
float decay_fast = 0.10f;
|
||||
float decay_slow = 0.30f;
|
||||
if (OPT(input_delay) < now - WD.screen->cursor->updated_at && ct->updated_at < now) {
|
||||
|
||||
if (os_window->live_resize.in_progress) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
ct->corner_x[i] = ct->cursor_edge_x[ci[i][0]];
|
||||
ct->corner_y[i] = ct->cursor_edge_y[ci[i][1]];
|
||||
}
|
||||
}
|
||||
else if (OPT(input_delay) < now - WD.screen->cursor->updated_at && ct->updated_at < now) {
|
||||
float cursor_center_x = (ct->cursor_edge_x[0] + ct->cursor_edge_x[1]) * 0.5f;
|
||||
float cursor_center_y = (ct->cursor_edge_y[0] + ct->cursor_edge_y[1]) * 0.5f;
|
||||
float cursor_diag_2 = norm(ct->cursor_edge_x[1] - ct->cursor_edge_x[0], ct->cursor_edge_y[1] - ct->cursor_edge_y[0]) * 0.5;
|
||||
|
||||
@@ -364,7 +364,7 @@ bool send_cell_data_to_gpu(ssize_t, float, float, float, float, Screen *, OSWind
|
||||
void draw_cells(ssize_t, const WindowRenderData*, OSWindow *, bool, bool, bool, Window*);
|
||||
void draw_centered_alpha_mask(OSWindow *w, size_t screen_width, size_t screen_height, size_t width, size_t height, uint8_t *canvas, float);
|
||||
void draw_cursor_trail(CursorTrail *trail);
|
||||
bool update_cursor_trail(CursorTrail *ct, Window *w, monotonic_t now);
|
||||
bool update_cursor_trail(CursorTrail *ct, Window *w, monotonic_t now, OSWindow *os_window);
|
||||
void update_surface_size(int, int, uint32_t);
|
||||
void free_texture(uint32_t*);
|
||||
void free_framebuffer(uint32_t*);
|
||||
|
||||
Reference in New Issue
Block a user