diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2020-02-07 15:25:20 +0000 |
---|---|---|
committer | Jonas Ã…dahl <jadahl@gmail.com> | 2020-02-10 09:02:30 +0000 |
commit | b2bc345463f0680443914490a399b15d30181bb1 (patch) | |
tree | 2ca9c51ebc593877e52bffc56a2d5900f89f9f9c | |
parent | 2235629d25175c8d000f6595179b7de690192f31 (diff) | |
download | mutter-b2bc345463f0680443914490a399b15d30181bb1.tar.gz |
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
(cherry picked from commit 934a829a57d0b00c5eef8d405473e8a56923cd22)
-rw-r--r-- | src/wayland/meta-wayland-subsurface.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c index 0d59cdf97..67557fb4d 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); @@ -497,7 +498,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) { @@ -546,9 +546,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 = { |