feedback-actor: Disable direct scanout during lifetime

We only support feedback-actors, such as DnD-icons, in the compositing
path at the moment.

The approach is similar to how we handle certain shell elements.
Implementations need to ensure no references to the object keep
around longer that necessary.

Arguably this should be replaced by a more robust and implicit actor
hierachy detection in the direct scanout code at some point.

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

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2677>
This commit is contained in:
Robert Mader 2022-10-25 21:16:41 +02:00
parent abfedcb0c3
commit 04655c8bff

View File

@ -59,6 +59,15 @@ meta_feedback_actor_constructed (GObject *object)
display = meta_get_display ();
feedback_group = meta_get_feedback_group_for_display (display);
clutter_actor_add_child (feedback_group, CLUTTER_ACTOR (object));
meta_disable_unredirect_for_display (display);
}
static void
meta_feedback_actor_finalize (GObject *object)
{
meta_enable_unredirect_for_display (meta_get_display ());
G_OBJECT_CLASS (meta_feedback_actor_parent_class)->finalize (object);
}
static void
@ -128,6 +137,7 @@ meta_feedback_actor_class_init (MetaFeedbackActorClass *klass)
GParamSpec *pspec;
object_class->constructed = meta_feedback_actor_constructed;
object_class->finalize = meta_feedback_actor_finalize;
object_class->set_property = meta_feedback_actor_set_property;
object_class->get_property = meta_feedback_actor_get_property;