[clutter] gdk: master clock: only process mapped & realized stages
- From: Lionel Landwerlin <llandwerlin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] gdk: master clock: only process mapped & realized stages
- Date: Mon, 7 Sep 2015 17:17:28 +0000 (UTC)
commit 5733ad58e5a3989f5cb836d42a1cebf3884e7c36
Author: Lionel Landwerlin <llandwerlin gmail com>
Date: Sat Sep 5 23:08:09 2015 +0100
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
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 228d31f..2a5db8a 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]