window-actor: Handle geometry scale

Geometry scale is applied to each surface individually, using
Clutter scales, and not only this breaks subsurfaces, it also
pollutes the toolkit and makes the actor tree slightly too
fragile. If GNOME Shell mistakenly tries to set the actor scale
of any of these surfaces, for example, various artifacts might
happen.

Move geometry scale handling to MetaWindowActor. It is applied
as a child transform operation, so that the Clutter-managed
scale properties are left untouched.

In the future where the entirety of the window is managed by a
ClutterContent itself, the geometry scale will be applied
directly into the transform matrix of MetaWindowActor. However,
doing that now would break the various ClutterClones used by
GNOME Shell, so the child transform is an acceptable compromise
during this transition.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
This commit is contained in:
Georges Basile Stavracas Neto
2019-07-12 14:33:17 -03:00
committed by Jonas Ådahl
parent c747be84d9
commit fb9e8768a3
6 changed files with 78 additions and 22 deletions

View File

@ -56,7 +56,6 @@ sync_actor_subsurface_state (MetaWaylandSurface *surface)
{
ClutterActor *actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
MetaWindow *toplevel_window;
int geometry_scale;
int x, y;
toplevel_window = meta_wayland_surface_get_toplevel_window (surface);
@ -66,9 +65,8 @@ sync_actor_subsurface_state (MetaWaylandSurface *surface)
if (toplevel_window->client_type == META_WINDOW_CLIENT_TYPE_X11)
return;
geometry_scale = meta_window_wayland_get_geometry_scale (toplevel_window);
x = (surface->offset_x + surface->sub.x) * geometry_scale;
y = (surface->offset_y + surface->sub.y) * geometry_scale;
x = surface->offset_x + surface->sub.x;
y = surface->offset_y + surface->sub.y;
clutter_actor_set_position (actor, x, y);