diff --git a/src/output.c b/src/output.c index eb57bbd..224f801 100644 --- a/src/output.c +++ b/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);