summaryrefslogtreecommitdiff
path: root/src/compositor/meta-window-actor.c
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2022-05-27 22:17:13 +0200
committerRobert Mader <robert.mader@posteo.de>2022-12-17 15:13:48 +0100
commit5e67e35ec54b9e0158a7465f9de890365b78a2a7 (patch)
treeadda9784308d5829bb6f432afd28bce89f49798a /src/compositor/meta-window-actor.c
parent4cc5e6d2bd1ae4dc74d2025f5c3fef3557a72caa (diff)
downloadmutter-5e67e35ec54b9e0158a7465f9de890365b78a2a7.tar.gz
compositor: Setup and use ownership chains
As with the backend commit, this means all objects can reach the MetaContext by walking up the chain, thus can e.g. get the backend from the context, instead of the global singleton. This also is a squashed commit containing: compositor: Get backend via the context The MetaCompositor instance is owned by MetaDisplay, which is owned by MetaContext. Get the backend via that chain of ownership. dnd: Don't get backend from singleton window-actor: Don't get backend from singleton dnd: Don't get Wayland compositor via singleton background: Don't get the monitor manager from the singleton plugins: Don't get backend from singleton This applies to MetaPlugin, it's manager class, and the default plugin. feedback-actor: Pass a compositor pointer when constructing This allows getting to the display. later: Keep a pointer to the manager object This allows using the non-singleton API in idle callbacks. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
Diffstat (limited to 'src/compositor/meta-window-actor.c')
-rw-r--r--src/compositor/meta-window-actor.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 8299a7b7d..ba90c4c28 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1222,13 +1222,16 @@ meta_window_actor_transform_cursor_position (MetaScreenCastWindow *screen_cast_w
meta_cursor_sprite_get_cogl_texture (cursor_sprite) &&
out_cursor_scale)
{
+ MetaDisplay *display = meta_compositor_get_display (priv->compositor);
+ MetaContext *context = meta_display_get_context (display);
+ MetaBackend *backend = meta_context_get_backend (context);
MetaLogicalMonitor *logical_monitor;
float view_scale;
float cursor_texture_scale;
logical_monitor = meta_window_get_main_logical_monitor (window);
- if (meta_is_stage_views_scaled ())
+ if (meta_backend_is_stage_views_scaled (backend))
view_scale = meta_logical_monitor_get_scale (logical_monitor);
else
view_scale = 1.0;
@@ -1436,8 +1439,11 @@ create_framebuffer_from_window_actor (MetaWindowActor *self,
MetaRectangle *clip,
GError **error)
{
+ MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self);
ClutterActor *actor = CLUTTER_ACTOR (self);
- MetaBackend *backend = meta_get_backend ();
+ MetaDisplay *display = meta_compositor_get_display (priv->compositor);
+ MetaContext *context = meta_display_get_context (display);
+ MetaBackend *backend = meta_context_get_backend (context);
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
CoglContext *cogl_context =
clutter_backend_get_cogl_context (clutter_backend);