aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-02-03 16:33:58 +0100
committeremersion <contact@emersion.fr>2018-02-03 16:33:58 +0100
commit6ba36cc52f83db2d21ef3e2fcb5b3dbf37c4d78e (patch)
treee344d6e0cebd2388724f5750f9c38b6890605265
parentfaa57341ca49b4cc0f2a51d420955339442a5fac (diff)
rootston: do not rely on current view size when accumulating damage
-rw-r--r--rootston/output.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/rootston/output.c b/rootston/output.c
index 7c520d86..8e9e2b73 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -549,12 +549,12 @@ static void damage_whole_surface(struct wlr_surface *surface,
return;
}
+ int ow, oh;
+ wlr_output_transformed_resolution(output->wlr_output, &ow, &oh);
+
struct wlr_box box;
- bool intersects = surface_intersect_output(surface, output->desktop->layout,
+ surface_intersect_output(surface, output->desktop->layout,
output->wlr_output, lx, ly, rotation, &box);
- if (!intersects) {
- return;
- }
// Take the surface damage and damage the whole surface
// The surface damage is still useful in case the surface got resized
@@ -564,6 +564,7 @@ static void damage_whole_surface(struct wlr_surface *surface,
wlr_region_scale(&damage, &damage, output->wlr_output->scale);
pixman_region32_union_rect(&damage, &damage, 0, 0, box.width, box.height);
pixman_region32_translate(&damage, box.x, box.y);
+ pixman_region32_intersect_rect(&damage, &damage, 0, 0, ow, oh);
pixman_box32_t *extents = pixman_region32_extents(&damage);
struct wlr_box extents_box = {
.x = extents->x1,
@@ -620,12 +621,12 @@ static void damage_from_surface(struct wlr_surface *surface,
return;
}
+ int ow, oh;
+ wlr_output_transformed_resolution(output->wlr_output, &ow, &oh);
+
struct wlr_box box;
- bool intersects = surface_intersect_output(surface, output->desktop->layout,
+ surface_intersect_output(surface, output->desktop->layout,
output->wlr_output, lx, ly, rotation, &box);
- if (!intersects) {
- return;
- }
pixman_region32_t damage;
pixman_region32_init(&damage);
@@ -638,6 +639,7 @@ static void damage_from_surface(struct wlr_surface *surface,
ceil(output->wlr_output->scale) - surface->current->scale);
}
pixman_region32_translate(&damage, box.x, box.y);
+ pixman_region32_intersect_rect(&damage, &damage, 0, 0, ow, oh);
pixman_region32_union(&output->damage, &output->damage, &damage);
pixman_region32_fini(&damage);