aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-06-13 20:58:26 -0400
committerSimon Ser <contact@emersion.fr>2023-06-15 14:57:51 +0000
commit43918459109f2a6e23b13bcb77487cd9b37df81f (patch)
treeb075209f7422398c552bf6948813c21d55b6b2eb
parent3896b6b10790260cf90722c2a624a9cc8995f0e7 (diff)
wlr_damage_ring_set_bounds: Ignore duplicate size requests
-rw-r--r--types/scene/wlr_scene.c1
-rw-r--r--types/wlr_damage_ring.c14
2 files changed, 10 insertions, 5 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c
index 32967dbe..447c96ab 100644
--- a/types/scene/wlr_scene.c
+++ b/types/scene/wlr_scene.c
@@ -1218,6 +1218,7 @@ static void scene_output_update_geometry(struct wlr_scene_output *scene_output)
int width, height;
wlr_output_transformed_resolution(scene_output->output, &width, &height);
wlr_damage_ring_set_bounds(&scene_output->damage_ring, width, height);
+ wlr_damage_ring_add_whole(&scene_output->damage_ring);
wlr_output_schedule_frame(scene_output->output);
scene_node_output_update(&scene_output->scene->tree.node,
diff --git a/types/wlr_damage_ring.c b/types/wlr_damage_ring.c
index 4623b915..ba270e69 100644
--- a/types/wlr_damage_ring.c
+++ b/types/wlr_damage_ring.c
@@ -29,12 +29,16 @@ void wlr_damage_ring_finish(struct wlr_damage_ring *ring) {
void wlr_damage_ring_set_bounds(struct wlr_damage_ring *ring,
int32_t width, int32_t height) {
if (width == 0 || height == 0) {
- ring->width = INT_MAX;
- ring->height = INT_MAX;
- } else {
- ring->width = width;
- ring->height = height;
+ width = INT_MAX;
+ height = INT_MAX;
+ }
+
+ if (ring->width == width && ring->height == height) {
+ return;
}
+
+ ring->width = width;
+ ring->height = height;
wlr_damage_ring_add_whole(ring);
}