mirror of
https://codeberg.org/vyivel/dulcepan/
synced 2025-12-17 07:35:13 +02:00
output: don't redraw if there's nothing to animate
This commit is contained in:
15
src/output.c
15
src/output.c
@@ -371,15 +371,22 @@ static void redraw(struct dp_output *output) {
|
||||
}
|
||||
|
||||
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);
|
||||
set_cairo_color(buffer->cairo, config->selected_color);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user