mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 10:00:45 -05:00
[layout] Make LayoutManager a floating object
A layout manager instance makes only sense if it's owned by a container. For this reason, it should have a floating reference instead of a full reference on construction; this allows constructing Boxes like: box = clutter_box_new (clutter_fixed_layout_new ()); without leaking the layout manager instance.
This commit is contained in:
parent
0340f65634
commit
141a155690
@ -281,7 +281,8 @@ clutter_box_set_property (GObject *gobject,
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_LAYOUT_MANAGER:
|
||||
priv->manager = g_value_dup_object (value);
|
||||
priv->manager = g_value_get_object (value);
|
||||
g_object_ref_sink (priv->manager);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -23,7 +23,9 @@
|
||||
G_OBJECT_TYPE_NAME (_obj), \
|
||||
(method)); } G_STMT_END
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (ClutterLayoutManager, clutter_layout_manager, G_TYPE_OBJECT);
|
||||
G_DEFINE_ABSTRACT_TYPE (ClutterLayoutManager,
|
||||
clutter_layout_manager,
|
||||
G_TYPE_INITIALLY_UNOWNED);
|
||||
|
||||
static void
|
||||
layout_manager_real_get_preferred_width (ClutterLayoutManager *manager,
|
||||
|
@ -30,7 +30,7 @@ typedef struct _ClutterLayoutManagerClass ClutterLayoutManagerClass;
|
||||
*/
|
||||
struct _ClutterLayoutManager
|
||||
{
|
||||
GObject parent_instance;
|
||||
GInitiallyUnowned parent_instance;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -43,7 +43,7 @@ struct _ClutterLayoutManager
|
||||
*/
|
||||
struct _ClutterLayoutManagerClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
GInitiallyUnownedClass parent_class;
|
||||
|
||||
void (* get_preferred_width) (ClutterLayoutManager *manager,
|
||||
ClutterContainer *container,
|
||||
|
Loading…
Reference in New Issue
Block a user