window-actor: add new signal "effects-completed"

When using plugins, the effects will affect the MetaWindowActor size
and position.

Add a new signal "effects-completed" wired to the corresponding
MetaWindowActor which is emitted when all effects are completed so that
derived objects can be notified when all effects are completed and use
the actual size and position.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/104
This commit is contained in:
Olivier Fourdan 2018-04-04 10:10:32 +02:00
parent deda7a5235
commit 85bbd82ae8
2 changed files with 25 additions and 0 deletions

View File

@ -58,5 +58,6 @@ void meta_window_actor_effect_completed (MetaWindowActor *actor,
MetaSurfaceActor *meta_window_actor_get_surface (MetaWindowActor *self);
void meta_window_actor_update_surface (MetaWindowActor *self);
MetaWindowActor *meta_window_actor_from_window (MetaWindow *window);
#endif /* META_WINDOW_ACTOR_PRIVATE_H */

View File

@ -142,6 +142,8 @@ struct _FrameData
enum
{
FIRST_FRAME,
EFFECTS_COMPLETED,
LAST_SIGNAL
};
@ -238,6 +240,21 @@ meta_window_actor_class_init (MetaWindowActorClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 0);
/**
* MetaWindowActor::effects-completed:
* @actor: the #MetaWindowActor instance
*
* The ::effects-completed signal will be emitted once all pending compositor
* effects are completed.
*/
signals[EFFECTS_COMPLETED] =
g_signal_new ("effects-completed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
pspec = g_param_spec_object ("meta-window",
"MetaWindow",
"The displayed MetaWindow",
@ -1131,6 +1148,7 @@ meta_window_actor_after_effects (MetaWindowActor *self)
return;
}
g_signal_emit (self, signals[EFFECTS_COMPLETED], 0);
meta_window_actor_sync_visibility (self);
meta_window_actor_sync_actor_geometry (self, FALSE);
}
@ -2157,3 +2175,9 @@ meta_window_actor_sync_updates_frozen (MetaWindowActor *self)
meta_window_actor_set_updates_frozen (self, meta_window_updates_are_frozen (window));
}
MetaWindowActor *
meta_window_actor_from_window (MetaWindow *window)
{
return META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
}