diff options
author | Lionel Landwerlin <llandwerlin@gmail.com> | 2015-09-05 23:08:09 +0100 |
---|---|---|
committer | Lionel Landwerlin <llandwerlin@gmail.com> | 2015-09-07 18:17:09 +0100 |
commit | 5733ad58e5a3989f5cb836d42a1cebf3884e7c36 (patch) | |
tree | 77f538cc6a5fc716cd829352055e306df421f975 | |
parent | 6183eb363282e5143bfd52aa36b5e6a318c4c992 (diff) | |
download | clutter-5733ad58e5a3989f5cb836d42a1cebf3884e7c36.tar.gz |
gdk: master clock: only process mapped & realized stages
When using Clutter embed inside a Gtk application, a stage might end
up realized but not visible. In this case we might discard doing any
kind of animation processing.
https://bugzilla.gnome.org/show_bug.cgi?id=754671
-rw-r--r-- | clutter/gdk/clutter-master-clock-gdk.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/clutter/gdk/clutter-master-clock-gdk.c b/clutter/gdk/clutter-master-clock-gdk.c index 228d31f12..2a5db8a44 100644 --- a/clutter/gdk/clutter-master-clock-gdk.c +++ b/clutter/gdk/clutter-master-clock-gdk.c @@ -385,11 +385,12 @@ clutter_master_clock_gdk_listen_to_stage (ClutterMasterClockGdk *master_clock, } static void -clutter_master_clock_gdk_stage_realized (ClutterStage *stage, - GParamSpec *spec, - ClutterMasterClockGdk *master_clock) +clutter_master_clock_gdk_stage_visibility (ClutterStage *stage, + GParamSpec *spec, + ClutterMasterClockGdk *master_clock) { - if (clutter_actor_is_realized (CLUTTER_ACTOR (stage))) + ClutterActor *actor = CLUTTER_ACTOR (stage); + if (clutter_actor_is_mapped (actor)) clutter_master_clock_gdk_listen_to_stage (master_clock, stage); else clutter_master_clock_gdk_remove_stage_clock (master_clock, stage); @@ -400,11 +401,11 @@ clutter_master_clock_gdk_stage_added (ClutterStageManager *manager, ClutterStage *stage, ClutterMasterClockGdk *master_clock) { - g_signal_connect (stage, "notify::realized", - G_CALLBACK (clutter_master_clock_gdk_stage_realized), + g_signal_connect (stage, "notify::mapped", + G_CALLBACK (clutter_master_clock_gdk_stage_visibility), master_clock); - clutter_master_clock_gdk_listen_to_stage (master_clock, stage); + clutter_master_clock_gdk_stage_visibility (stage, NULL, master_clock); } static void @@ -415,7 +416,7 @@ clutter_master_clock_gdk_stage_removed (ClutterStageManager *manager, clutter_master_clock_gdk_remove_stage_clock (master_clock, stage); g_signal_handlers_disconnect_by_func (stage, - clutter_master_clock_gdk_stage_realized, + clutter_master_clock_gdk_stage_visibility, master_clock); } |