summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mader <robert.mader@posteo.de>2018-07-02 12:22:30 +0200
committerRobert Mader <robert.mader@liqd.de>2018-08-21 12:24:02 +0200
commit6a92c6f83f8eb6f5be6a43b4c36ca464f4543f88 (patch)
treed95e72da84477414e0521f69debf01ba6d1b40a2
parentb8340f1355bb1949511effb7868aa2ef7e3731dd (diff)
downloadmutter-6a92c6f83f8eb6f5be6a43b4c36ca464f4543f88.tar.gz
wayland/actor-surface: Intersect input/opaque region with surface region
As per specification > The compositor ignores the parts of the input region that > fall outside of the surface. > The compositor ignores the parts of the opaque region that > fall outside of the surface This fixes culling problems under certain conditions.
-rw-r--r--src/wayland/meta-wayland-actor-surface.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c
index ffa7b31e9..3c60ed56e 100644
--- a/src/wayland/meta-wayland-actor-surface.c
+++ b/src/wayland/meta-wayland-actor-surface.c
@@ -140,6 +140,7 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
MetaShapedTexture *stex;
double actor_scale;
GList *l;
+ cairo_rectangle_int_t surface_rect;
surface_actor = priv->actor;
stex = meta_surface_actor_get_texture (surface_actor);
@@ -147,6 +148,11 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
actor_scale = meta_wayland_actor_surface_calculate_scale (actor_surface);
clutter_actor_set_scale (CLUTTER_ACTOR (stex), actor_scale, actor_scale);
+ surface_rect = (cairo_rectangle_int_t) {
+ .width = meta_wayland_surface_get_width (surface),
+ .height = meta_wayland_surface_get_height (surface),
+ };
+
if (surface->input_region)
{
cairo_region_t *scaled_input_region;
@@ -156,6 +162,7 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
region_scale = (int) (surface->scale * actor_scale);
scaled_input_region = meta_region_scale (surface->input_region,
region_scale);
+ cairo_region_intersect_rectangle (scaled_input_region, &surface_rect);
meta_surface_actor_set_input_region (surface_actor, scaled_input_region);
cairo_region_destroy (scaled_input_region);
}
@@ -171,6 +178,7 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
/* Wayland surface coordinate space -> stage coordinate space */
scaled_opaque_region = meta_region_scale (surface->opaque_region,
surface->scale);
+ cairo_region_intersect_rectangle (scaled_opaque_region, &surface_rect);
meta_surface_actor_set_opaque_region (surface_actor,
scaled_opaque_region);
cairo_region_destroy (scaled_opaque_region);