Commit 41130b08 authored by Robert Mader's avatar Robert Mader
Browse files

surface-actor: Add culling offset for geometry scale

This fixes a case that was overlooked in
!1036 - when we
have a geometry scale > 1 and Wayland subsurfaces that have an offset
to their parent surface (which is often the case when the toplevel surface
includes decoration/shadows etc.), we have to add extra offset to their
opaque regions so they match their 'visible' location.

This is necessary as `meta_cullable_cull_out_children` moves the coordinate
system during culling, but does not know about geometry scale.

Also, remove the redundant check for `window_actor` - we only hit this code
path if a `window_actor` culls out its children.

parent 1d200452
Pipeline #163055 passed with stages
in 5 minutes and 36 seconds
......@@ -282,7 +282,8 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
MetaWindowActor *window_actor;
cairo_region_t *scaled_opaque_region;
cairo_region_t *opaque_region;
int geometry_scale = 1;
int geometry_scale;
float x, y;
opaque_region = meta_shaped_texture_get_opaque_region (priv->texture);
if (opaque_region)
......@@ -305,12 +306,14 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
window_actor =
meta_window_actor_from_actor (CLUTTER_ACTOR (surface_actor));
if (window_actor)
geometry_scale = meta_window_actor_get_geometry_scale (window_actor);
window_actor = meta_window_actor_from_actor (CLUTTER_ACTOR (surface_actor));
geometry_scale = meta_window_actor_get_geometry_scale (window_actor);
clutter_actor_get_position (CLUTTER_ACTOR (surface_actor), &x, &y);
cairo_region_translate (opaque_region, x, y);
scaled_opaque_region = meta_region_scale (opaque_region, geometry_scale);
cairo_region_translate (scaled_opaque_region, -x, -y);
cairo_region_translate (opaque_region, -x, -y);
if (unobscured_region)
cairo_region_subtract (unobscured_region, scaled_opaque_region);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment