wayland/shell: Apply geometry after subsurface state application

The subsurface state may affect the geometry end result, e.g. when
window decoration enlarging the toplevel window are applied. If we don't
wait with calculating the window geometry, intersecting the set region
with the subsurface tree extents will not include the subsurfaces.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/928

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1295
This commit is contained in:
Jonas Ådahl
2020-06-08 09:13:44 +02:00
committed by Robert Mader
parent be59b514ca
commit d6af59612c
4 changed files with 140 additions and 32 deletions

View File

@@ -113,6 +113,10 @@ static void
meta_wayland_surface_role_apply_state (MetaWaylandSurfaceRole *surface_role,
MetaWaylandSurfaceState *pending);
static void
meta_wayland_surface_role_post_apply_state (MetaWaylandSurfaceRole *surface_role,
MetaWaylandSurfaceState *pending);
static gboolean
meta_wayland_surface_role_is_on_logical_monitor (MetaWaylandSurfaceRole *surface_role,
MetaLogicalMonitor *logical_monitor);
@@ -787,8 +791,6 @@ cleanup:
surface_state_signals[SURFACE_STATE_SIGNAL_APPLIED],
0);
meta_wayland_surface_state_reset (state);
META_WAYLAND_SURFACE_FOREACH_SUBSURFACE (surface, subsurface_surface)
{
MetaWaylandSubsurface *subsurface;
@@ -812,6 +814,11 @@ cleanup:
meta_window_actor_notify_damaged (toplevel_window_actor);
}
}
if (surface->role)
meta_wayland_surface_role_post_apply_state (surface->role, state);
meta_wayland_surface_state_reset (state);
}
void
@@ -1755,6 +1762,17 @@ meta_wayland_surface_role_pre_apply_state (MetaWaylandSurfaceRole *surface_role
klass->pre_apply_state (surface_role, pending);
}
static void
meta_wayland_surface_role_post_apply_state (MetaWaylandSurfaceRole *surface_role,
MetaWaylandSurfaceState *pending)
{
MetaWaylandSurfaceRoleClass *klass;
klass = META_WAYLAND_SURFACE_ROLE_GET_CLASS (surface_role);
if (klass->post_apply_state)
klass->post_apply_state (surface_role, pending);
}
static void
meta_wayland_surface_role_apply_state (MetaWaylandSurfaceRole *surface_role,
MetaWaylandSurfaceState *pending)