1
0
mirror of https://codeberg.org/vyivel/dulcepan/ synced 2025-12-17 15:45:12 +02:00

output: don't redraw if there's nothing to animate

This commit is contained in:
Kirill Primak
2024-07-03 13:32:19 +03:00
parent 5ce4818cd5
commit e81e274380

View File

@@ -371,15 +371,22 @@ static void redraw(struct dp_output *output) {
} }
cairo_stroke(buffer->cairo); cairo_stroke(buffer->cairo);
if (config->border_gradient != DP_BORDER_GRADIENT_NONE &&
config->animation_duration != 0) {
bool whole = selection->x == 0 && selection->y == 0 &&
selection->width == output->effective_width &&
selection->height == output->effective_height;
if (!whole) {
// The border is animated and visible
output->needs_redraw = true;
}
}
} }
cairo_rectangle(buffer->cairo, x, y, width, height); cairo_rectangle(buffer->cairo, x, y, width, height);
set_cairo_color(buffer->cairo, config->selected_color); set_cairo_color(buffer->cairo, config->selected_color);
cairo_fill(buffer->cairo); cairo_fill(buffer->cairo);
if (config->border_gradient != DP_BORDER_GRADIENT_NONE && config->animation_duration != 0) {
output->needs_redraw = true;
}
} }
wl_surface_attach(output->select_surface, buffer->wl_buffer, 0, 0); wl_surface_attach(output->select_surface, buffer->wl_buffer, 0, 0);