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
This commit is contained in:
parent
ca82cde6dd
commit
59eebd6f6d
@ -33,6 +33,7 @@ enum
|
|||||||
PROP_0,
|
PROP_0,
|
||||||
|
|
||||||
PROP_NAME,
|
PROP_NAME,
|
||||||
|
PROP_STAGE,
|
||||||
PROP_LAYOUT,
|
PROP_LAYOUT,
|
||||||
PROP_FRAMEBUFFER,
|
PROP_FRAMEBUFFER,
|
||||||
PROP_OFFSCREEN,
|
PROP_OFFSCREEN,
|
||||||
@ -48,6 +49,8 @@ typedef struct _ClutterStageViewPrivate
|
|||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
|
ClutterStage *stage;
|
||||||
|
|
||||||
cairo_rectangle_int_t layout;
|
cairo_rectangle_int_t layout;
|
||||||
float scale;
|
float scale;
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
@ -1003,6 +1006,9 @@ clutter_stage_view_get_property (GObject *object,
|
|||||||
case PROP_NAME:
|
case PROP_NAME:
|
||||||
g_value_set_string (value, priv->name);
|
g_value_set_string (value, priv->name);
|
||||||
break;
|
break;
|
||||||
|
case PROP_STAGE:
|
||||||
|
g_value_set_boxed (value, &priv->stage);
|
||||||
|
break;
|
||||||
case PROP_LAYOUT:
|
case PROP_LAYOUT:
|
||||||
g_value_set_boxed (value, &priv->layout);
|
g_value_set_boxed (value, &priv->layout);
|
||||||
break;
|
break;
|
||||||
@ -1039,6 +1045,9 @@ clutter_stage_view_set_property (GObject *object,
|
|||||||
case PROP_NAME:
|
case PROP_NAME:
|
||||||
priv->name = g_value_dup_string (value);
|
priv->name = g_value_dup_string (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_STAGE:
|
||||||
|
priv->stage = g_value_get_object (value);
|
||||||
|
break;
|
||||||
case PROP_LAYOUT:
|
case PROP_LAYOUT:
|
||||||
layout = g_value_get_boxed (value);
|
layout = g_value_get_boxed (value);
|
||||||
priv->layout = *layout;
|
priv->layout = *layout;
|
||||||
@ -1146,6 +1155,16 @@ clutter_stage_view_class_init (ClutterStageViewClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_CONSTRUCT_ONLY |
|
G_PARAM_CONSTRUCT_ONLY |
|
||||||
G_PARAM_STATIC_STRINGS);
|
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] =
|
obj_props[PROP_LAYOUT] =
|
||||||
g_param_spec_boxed ("layout",
|
g_param_spec_boxed ("layout",
|
||||||
"View layout",
|
"View layout",
|
||||||
|
@ -3247,6 +3247,7 @@ meta_renderer_native_create_view (MetaRenderer *renderer,
|
|||||||
&view_layout);
|
&view_layout);
|
||||||
view = g_object_new (META_TYPE_RENDERER_VIEW,
|
view = g_object_new (META_TYPE_RENDERER_VIEW,
|
||||||
"name", meta_output_get_name (output),
|
"name", meta_output_get_name (output),
|
||||||
|
"stage", meta_backend_get_stage (backend),
|
||||||
"layout", &view_layout,
|
"layout", &view_layout,
|
||||||
"scale", scale,
|
"scale", scale,
|
||||||
"framebuffer", onscreen,
|
"framebuffer", onscreen,
|
||||||
|
@ -164,6 +164,7 @@ meta_renderer_x11_nested_ensure_legacy_view (MetaRendererX11Nested *renderer_x11
|
|||||||
};
|
};
|
||||||
legacy_view = g_object_new (META_TYPE_RENDERER_VIEW,
|
legacy_view = g_object_new (META_TYPE_RENDERER_VIEW,
|
||||||
"name", "legacy nested",
|
"name", "legacy nested",
|
||||||
|
"stage", meta_backend_get_stage (backend),
|
||||||
"layout", &view_layout,
|
"layout", &view_layout,
|
||||||
"framebuffer", COGL_FRAMEBUFFER (fake_onscreen),
|
"framebuffer", COGL_FRAMEBUFFER (fake_onscreen),
|
||||||
NULL);
|
NULL);
|
||||||
@ -216,6 +217,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer,
|
|||||||
|
|
||||||
view = g_object_new (META_TYPE_RENDERER_VIEW,
|
view = g_object_new (META_TYPE_RENDERER_VIEW,
|
||||||
"name", meta_output_get_name (output),
|
"name", meta_output_get_name (output),
|
||||||
|
"stage", meta_backend_get_stage (backend),
|
||||||
"layout", &view_layout,
|
"layout", &view_layout,
|
||||||
"framebuffer", COGL_FRAMEBUFFER (fake_onscreen),
|
"framebuffer", COGL_FRAMEBUFFER (fake_onscreen),
|
||||||
"offscreen", COGL_FRAMEBUFFER (offscreen),
|
"offscreen", COGL_FRAMEBUFFER (offscreen),
|
||||||
|
Loading…
Reference in New Issue
Block a user