mirror of
https://codeberg.org/vyivel/dulcepan/
synced 2026-10-13 04:58:22 +03:00
output: don't redraw if there's nothing to animate
This commit is contained in:
1 parent
5ce4818cd5
commit
e81e274380
1 file changed
+11
-4
+11
-4
@@ -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