mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
window-actor: Don't connect to allocation-changed
This can cause allocation loops. Connect to size-changed to update the shape instead.
This commit is contained in:
parent
6c624e1c26
commit
6954d23444
@ -76,7 +76,6 @@ struct _MetaWindowActorPrivate
|
|||||||
gint64 frame_drawn_time;
|
gint64 frame_drawn_time;
|
||||||
|
|
||||||
guint repaint_scheduled_id;
|
guint repaint_scheduled_id;
|
||||||
guint allocation_changed_id;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These need to be counters rather than flags, since more plugins
|
* These need to be counters rather than flags, since more plugins
|
||||||
@ -273,12 +272,11 @@ window_appears_focused_notify (MetaWindow *mw,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
surface_allocation_changed_notify (ClutterActor *actor,
|
window_size_changed (MetaWindow *mw,
|
||||||
const ClutterActorBox *allocation,
|
gpointer data)
|
||||||
ClutterAllocationFlags flags,
|
|
||||||
MetaWindowActor *self)
|
|
||||||
{
|
{
|
||||||
meta_window_actor_sync_actor_geometry (self, FALSE);
|
MetaWindowActor *self = META_WINDOW_ACTOR (data);
|
||||||
|
|
||||||
meta_window_actor_update_shape (self);
|
meta_window_actor_update_shape (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,8 +369,6 @@ set_surface (MetaWindowActor *self,
|
|||||||
{
|
{
|
||||||
g_signal_handler_disconnect (priv->surface, priv->repaint_scheduled_id);
|
g_signal_handler_disconnect (priv->surface, priv->repaint_scheduled_id);
|
||||||
priv->repaint_scheduled_id = 0;
|
priv->repaint_scheduled_id = 0;
|
||||||
g_signal_handler_disconnect (priv->surface, priv->allocation_changed_id);
|
|
||||||
priv->allocation_changed_id = 0;
|
|
||||||
clutter_actor_remove_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
|
clutter_actor_remove_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
|
||||||
g_object_unref (priv->surface);
|
g_object_unref (priv->surface);
|
||||||
}
|
}
|
||||||
@ -384,8 +380,6 @@ set_surface (MetaWindowActor *self,
|
|||||||
g_object_ref_sink (priv->surface);
|
g_object_ref_sink (priv->surface);
|
||||||
priv->repaint_scheduled_id = g_signal_connect (priv->surface, "repaint-scheduled",
|
priv->repaint_scheduled_id = g_signal_connect (priv->surface, "repaint-scheduled",
|
||||||
G_CALLBACK (surface_repaint_scheduled), self);
|
G_CALLBACK (surface_repaint_scheduled), self);
|
||||||
priv->allocation_changed_id = g_signal_connect (priv->surface, "allocation-changed",
|
|
||||||
G_CALLBACK (surface_allocation_changed_notify), self);
|
|
||||||
clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
|
clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
|
||||||
|
|
||||||
/* If the previous surface actor was frozen, start out
|
/* If the previous surface actor was frozen, start out
|
||||||
@ -495,6 +489,8 @@ meta_window_actor_set_property (GObject *object,
|
|||||||
priv->window = g_value_dup_object (value);
|
priv->window = g_value_dup_object (value);
|
||||||
g_signal_connect_object (priv->window, "notify::appears-focused",
|
g_signal_connect_object (priv->window, "notify::appears-focused",
|
||||||
G_CALLBACK (window_appears_focused_notify), self, 0);
|
G_CALLBACK (window_appears_focused_notify), self, 0);
|
||||||
|
g_signal_connect_object (priv->window, "size-changed",
|
||||||
|
G_CALLBACK (window_size_changed), self, 0);
|
||||||
break;
|
break;
|
||||||
case PROP_NO_SHADOW:
|
case PROP_NO_SHADOW:
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user