From 4cc5e6d2bd1ae4dc74d2025f5c3fef3557a72caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 30 May 2022 23:08:26 +0200 Subject: [PATCH] compositor: Add API to get feedback group It already had, except it was accessed via the MetaDisplay. Part-of: --- src/compositor/compositor.c | 23 ++++++++++++++++++----- src/meta/compositor.h | 3 +++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index f8ea427c3..ef9252bd2 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -266,6 +266,23 @@ meta_get_top_window_group_for_display (MetaDisplay *display) return priv->top_window_group; } +/** + * meta_compositor_get_feedback_group: + * @compositor: a #MetaCompositor + * + * Returns: (transfer none): The feedback group corresponding to @display + */ +ClutterActor * +meta_compositor_get_feedback_group (MetaCompositor *compositor) +{ + MetaCompositorPrivate *priv; + + g_return_val_if_fail (compositor, NULL); + priv = meta_compositor_get_instance_private (compositor); + + return priv->feedback_group; +} + /** * meta_get_feedback_group_for_display: * @display: a #MetaDisplay @@ -276,15 +293,11 @@ ClutterActor * meta_get_feedback_group_for_display (MetaDisplay *display) { MetaCompositor *compositor; - MetaCompositorPrivate *priv; g_return_val_if_fail (display, NULL); compositor = get_compositor_for_display (display); - g_return_val_if_fail (compositor, NULL); - priv = meta_compositor_get_instance_private (compositor); - - return priv->feedback_group; + return meta_compositor_get_feedback_group (compositor); } /** diff --git a/src/meta/compositor.h b/src/meta/compositor.h index 9308ed852..f06f95227 100644 --- a/src/meta/compositor.h +++ b/src/meta/compositor.h @@ -166,4 +166,7 @@ void meta_compositor_show_window_menu_for_rect (MetaCompositor *compositor, META_EXPORT MetaLaters * meta_compositor_get_laters (MetaCompositor *compositor); +META_EXPORT +ClutterActor * meta_compositor_get_feedback_group (MetaCompositor *compositor); + #endif /* META_COMPOSITOR_H */