[mutter] wayland/subsurface: Keep subsurface actors reactive



commit 934a829a57d0b00c5eef8d405473e8a56923cd22
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Fri Feb 7 16:25:20 2020 +0100

    wayland/subsurface: Keep subsurface actors reactive
    
    The actors of Wayland subsurfaces are set to be reactive on creation,
    when receiving the `wl_subcompositor.get_subsurface` request.
    
    However, if a client creates several subsurfaces and then creates the
    xdg_toplevel object after, the previous subsurface actors are reset.
    
    As a result, Clutter picking will skip and ignore those actors in
    `clutter_actor_should_pick_paint()` because they aren't marked as
    reactive anymore.
    
    An example of such a client being affected by this issue is SCTK, the
    Rust library implementing client side decorations for Wayland used
    internally by winit and alacritty.
    
    Move the `set_reactive()` call from `get_subsurface()` to the subsurface
    `sync_actor_subsurface_state()` vfunc to make sure those remain reactive
    even after `xdg_surface.get_toplevel` is invoked.
    
    Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1024
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1040

 src/wayland/meta-wayland-subsurface.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index 38ae6d979..3e5632010 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -85,6 +85,7 @@ sync_actor_subsurface_state (MetaWaylandSurface *surface)
   transform_subsurface_position (surface, &x, &y);
 
   clutter_actor_set_position (actor, x, y);
+  clutter_actor_set_reactive (actor, TRUE);
 
   if (surface->buffer_ref.buffer)
     clutter_actor_show (actor);
@@ -519,7 +520,6 @@ wl_subcompositor_get_subsurface (struct wl_client   *client,
   MetaWaylandSurface *parent = wl_resource_get_user_data (parent_resource);
   MetaWindow *toplevel_window;
   MetaWindowActor *window_actor;
-  MetaSurfaceActor *surface_actor;
 
   if (surface->wl_subsurface)
     {
@@ -567,9 +567,6 @@ wl_subcompositor_get_subsurface (struct wl_client   *client,
   window_actor = meta_window_actor_wayland_from_surface (surface);
   if (window_actor)
     meta_window_actor_wayland_rebuild_surface_tree (window_actor);
-
-  surface_actor = meta_wayland_surface_get_actor (surface);
-  clutter_actor_set_reactive (CLUTTER_ACTOR (surface_actor), TRUE);
 }
 
 static const struct wl_subcompositor_interface meta_wayland_subcompositor_interface = {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]