[mutter] clutter/stage-view: Pass a pointer to the stage during constuction
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/stage-view: Pass a pointer to the stage during constuction
- Date: Thu, 2 Jul 2020 20:51:13 +0000 (UTC)
commit 59eebd6f6d7bc840c1a315d313b6bc285ca4508b
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Mon Mar 30 17:34:43 2020 +0200
clutter/stage-view: Pass a pointer to the stage during constuction
This is so that stage views can interact with the stage they are views
of.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
clutter/clutter/clutter-stage-view.c | 19 +++++++++++++++++++
src/backends/native/meta-renderer-native.c | 1 +
src/backends/x11/nested/meta-renderer-x11-nested.c | 2 ++
3 files changed, 22 insertions(+)
---
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index efc9d67a85..29f43332b0 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -33,6 +33,7 @@ enum
PROP_0,
PROP_NAME,
+ PROP_STAGE,
PROP_LAYOUT,
PROP_FRAMEBUFFER,
PROP_OFFSCREEN,
@@ -48,6 +49,8 @@ typedef struct _ClutterStageViewPrivate
{
char *name;
+ ClutterStage *stage;
+
cairo_rectangle_int_t layout;
float scale;
CoglFramebuffer *framebuffer;
@@ -1003,6 +1006,9 @@ clutter_stage_view_get_property (GObject *object,
case PROP_NAME:
g_value_set_string (value, priv->name);
break;
+ case PROP_STAGE:
+ g_value_set_boxed (value, &priv->stage);
+ break;
case PROP_LAYOUT:
g_value_set_boxed (value, &priv->layout);
break;
@@ -1039,6 +1045,9 @@ clutter_stage_view_set_property (GObject *object,
case PROP_NAME:
priv->name = g_value_dup_string (value);
break;
+ case PROP_STAGE:
+ priv->stage = g_value_get_object (value);
+ break;
case PROP_LAYOUT:
layout = g_value_get_boxed (value);
priv->layout = *layout;
@@ -1146,6 +1155,16 @@ clutter_stage_view_class_init (ClutterStageViewClass *klass)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
+
+ obj_props[PROP_STAGE] =
+ g_param_spec_object ("stage",
+ "The stage",
+ "The ClutterStage",
+ CLUTTER_TYPE_STAGE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS);
+
obj_props[PROP_LAYOUT] =
g_param_spec_boxed ("layout",
"View layout",
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 8ec809b9df..24756c891c 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -3247,6 +3247,7 @@ meta_renderer_native_create_view (MetaRenderer *renderer,
&view_layout);
view = g_object_new (META_TYPE_RENDERER_VIEW,
"name", meta_output_get_name (output),
+ "stage", meta_backend_get_stage (backend),
"layout", &view_layout,
"scale", scale,
"framebuffer", onscreen,
diff --git a/src/backends/x11/nested/meta-renderer-x11-nested.c
b/src/backends/x11/nested/meta-renderer-x11-nested.c
index b4ad3ce8f1..cf3244d5a1 100644
--- a/src/backends/x11/nested/meta-renderer-x11-nested.c
+++ b/src/backends/x11/nested/meta-renderer-x11-nested.c
@@ -164,6 +164,7 @@ meta_renderer_x11_nested_ensure_legacy_view (MetaRendererX11Nested *renderer_x11
};
legacy_view = g_object_new (META_TYPE_RENDERER_VIEW,
"name", "legacy nested",
+ "stage", meta_backend_get_stage (backend),
"layout", &view_layout,
"framebuffer", COGL_FRAMEBUFFER (fake_onscreen),
NULL);
@@ -216,6 +217,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer,
view = g_object_new (META_TYPE_RENDERER_VIEW,
"name", meta_output_get_name (output),
+ "stage", meta_backend_get_stage (backend),
"layout", &view_layout,
"framebuffer", COGL_FRAMEBUFFER (fake_onscreen),
"offscreen", COGL_FRAMEBUFFER (offscreen),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]