diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c index e4f10b5ac..1580a8493 100644 --- a/clutter/clutter/clutter-stage-view.c +++ b/clutter/clutter/clutter-stage-view.c @@ -31,6 +31,7 @@ enum { PROP_0, + PROP_NAME, PROP_LAYOUT, PROP_FRAMEBUFFER, PROP_OFFSCREEN, @@ -44,6 +45,8 @@ static GParamSpec *obj_props[PROP_LAST]; typedef struct _ClutterStageViewPrivate { + char *name; + cairo_rectangle_int_t layout; float scale; CoglFramebuffer *framebuffer; @@ -442,6 +445,9 @@ clutter_stage_view_get_property (GObject *object, switch (prop_id) { + case PROP_NAME: + g_value_set_string (value, priv->name); + break; case PROP_LAYOUT: g_value_set_boxed (value, &priv->layout); break; @@ -475,6 +481,9 @@ clutter_stage_view_set_property (GObject *object, switch (prop_id) { + case PROP_NAME: + priv->name = g_value_dup_string (value); + break; case PROP_LAYOUT: layout = g_value_get_boxed (value); priv->layout = *layout; @@ -517,6 +526,7 @@ clutter_stage_view_dispose (GObject *object) ClutterStageViewPrivate *priv = clutter_stage_view_get_instance_private (view); + g_clear_pointer (&priv->name, g_free); g_clear_pointer (&priv->framebuffer, cogl_object_unref); g_clear_pointer (&priv->shadowfb, cogl_object_unref); g_clear_pointer (&priv->offscreen, cogl_object_unref); @@ -550,6 +560,14 @@ clutter_stage_view_class_init (ClutterStageViewClass *klass) object_class->set_property = clutter_stage_view_set_property; object_class->dispose = clutter_stage_view_dispose; + obj_props[PROP_NAME] = + g_param_spec_string ("name", + "Name", + "Name of view", + NULL, + 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 a717012ce..7b47174a0 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -3230,6 +3230,7 @@ meta_renderer_native_create_view (MetaRenderer *renderer, META_ROUNDING_STRATEGY_ROUND, &view_layout); view = g_object_new (META_TYPE_RENDERER_VIEW, + "name", meta_output_get_name (output), "layout", &view_layout, "scale", scale, "framebuffer", onscreen, diff --git a/src/backends/x11/cm/meta-renderer-x11-cm.c b/src/backends/x11/cm/meta-renderer-x11-cm.c index 2490b055d..a288fe61f 100644 --- a/src/backends/x11/cm/meta-renderer-x11-cm.c +++ b/src/backends/x11/cm/meta-renderer-x11-cm.c @@ -51,6 +51,7 @@ meta_renderer_x11_cm_ensure_screen_view (MetaRendererX11Cm *renderer_x11_cm, .height = height, }; renderer_x11_cm->screen_view = g_object_new (META_TYPE_RENDERER_VIEW, + "name", "X11 screen", "layout", &view_layout, NULL); meta_renderer_add_view (META_RENDERER (renderer_x11_cm), diff --git a/src/backends/x11/nested/meta-renderer-x11-nested.c b/src/backends/x11/nested/meta-renderer-x11-nested.c index 0223fe87e..e5ac8ae4b 100644 --- a/src/backends/x11/nested/meta-renderer-x11-nested.c +++ b/src/backends/x11/nested/meta-renderer-x11-nested.c @@ -163,6 +163,7 @@ meta_renderer_x11_nested_ensure_legacy_view (MetaRendererX11Nested *renderer_x11 .height = height }; legacy_view = g_object_new (META_TYPE_RENDERER_VIEW, + "name", "legacy nested", "layout", &view_layout, "framebuffer", COGL_FRAMEBUFFER (fake_onscreen), NULL); @@ -212,6 +213,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer, &view_layout); view = g_object_new (META_TYPE_RENDERER_VIEW, + "name", meta_output_get_name (output), "layout", &view_layout, "framebuffer", COGL_FRAMEBUFFER (fake_onscreen), "offscreen", COGL_FRAMEBUFFER (offscreen),