mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
wayland: Move tree updating to the shell surface role
The shell surface role is the one where subsurfaces may exist, and it has direct relation to the MetaWindowActorWayland which currently has the subsurface stacking logic. Instead of directly finding the window actor when dealing with subsurfaces, notify the parent surface that the subsurface state changed, so that it can outsource the application of this information to the role. For subsurface roles, this simply means forward upward to the parent; for shell surface roles, this means regenerate the surface actor layering. This allows us to move away from accessing the window directly from the surface, which in turn allows us to change the ownership structure of windows. https://gitlab.gnome.org/GNOME/mutter/merge_requests/835
This commit is contained in:

committed by
Robert Mader

parent
ac2c870177
commit
5149e1e43a
@ -139,7 +139,6 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface)
|
||||
{
|
||||
GSList *it;
|
||||
MetaWaylandSurface *parent;
|
||||
MetaWindowActor *window_actor;
|
||||
|
||||
parent = surface->sub.parent;
|
||||
|
||||
@ -184,9 +183,7 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface)
|
||||
g_slist_free (surface->sub.pending_placement_ops);
|
||||
surface->sub.pending_placement_ops = NULL;
|
||||
|
||||
window_actor = meta_window_actor_wayland_from_surface (surface);
|
||||
if (window_actor)
|
||||
meta_window_actor_wayland_rebuild_surface_tree (window_actor);
|
||||
meta_wayland_surface_notify_subsurface_state_changed (parent);
|
||||
}
|
||||
|
||||
if (is_surface_effectively_synchronized (surface))
|
||||
@ -258,6 +255,16 @@ meta_wayland_subsurface_should_cache_state (MetaWaylandSurfaceRole *surface_role
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_subsurface_notify_subsurface_state_changed (MetaWaylandSurfaceRole *surface_role)
|
||||
{
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (surface_role);
|
||||
MetaWaylandSurface *parent = surface->sub.parent;
|
||||
|
||||
return meta_wayland_surface_notify_subsurface_state_changed (parent);
|
||||
}
|
||||
|
||||
static double
|
||||
meta_wayland_subsurface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
|
||||
{
|
||||
@ -313,6 +320,8 @@ meta_wayland_subsurface_class_init (MetaWaylandSubsurfaceClass *klass)
|
||||
|
||||
surface_role_class->get_toplevel = meta_wayland_subsurface_get_toplevel;
|
||||
surface_role_class->should_cache_state = meta_wayland_subsurface_should_cache_state;
|
||||
surface_role_class->notify_subsurface_state_changed =
|
||||
meta_wayland_subsurface_notify_subsurface_state_changed;
|
||||
|
||||
actor_surface_class->get_geometry_scale =
|
||||
meta_wayland_subsurface_get_geometry_scale;
|
||||
@ -519,7 +528,6 @@ wl_subcompositor_get_subsurface (struct wl_client *client,
|
||||
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
|
||||
MetaWaylandSurface *parent = wl_resource_get_user_data (parent_resource);
|
||||
MetaWindow *toplevel_window;
|
||||
MetaWindowActor *window_actor;
|
||||
|
||||
if (surface->wl_subsurface)
|
||||
{
|
||||
@ -564,9 +572,7 @@ wl_subcompositor_get_subsurface (struct wl_client *client,
|
||||
g_node_append (parent->subsurface_branch_node,
|
||||
surface->subsurface_branch_node);
|
||||
|
||||
window_actor = meta_window_actor_wayland_from_surface (surface);
|
||||
if (window_actor)
|
||||
meta_window_actor_wayland_rebuild_surface_tree (window_actor);
|
||||
meta_wayland_surface_notify_subsurface_state_changed (parent);
|
||||
}
|
||||
|
||||
static const struct wl_subcompositor_interface meta_wayland_subcompositor_interface = {
|
||||
|
Reference in New Issue
Block a user