diff options
author | Lionel Landwerlin <llandwerlin@gmail.com> | 2015-09-11 13:15:16 +0200 |
---|---|---|
committer | Lionel Landwerlin <llandwerlin@gmail.com> | 2015-09-12 00:39:43 +0200 |
commit | cb4e88884bc811120dabcf473503d23a21044618 (patch) | |
tree | 491a827da4a5120479fb1f99280f231fef05ef8a | |
parent | 5d83260b19c06f216cfdb21a57f256ebee1affef (diff) | |
download | clutter-cb4e88884bc811120dabcf473503d23a21044618.tar.gz |
gdk: master clock: hook ourselves to the paint signal
We're currently hooked to the "update" signal of the FrameClock. When
embedding Clutter inside GTK+ we want to have the layout phase of GTK+
to notify us the size of our stage.
This patch change to FrameClock signal we're listening to, to the
"paint" signal to make sure we've received the layout information from
GTK+, before painting. Otherwise we paint with a delay of one frame.
https://bugzilla.gnome.org/show_bug.cgi?id=754889
-rw-r--r-- | clutter/gdk/clutter-master-clock-gdk.c | 6 | ||||
-rw-r--r-- | clutter/gdk/clutter-stage-gdk.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/clutter/gdk/clutter-master-clock-gdk.c b/clutter/gdk/clutter-master-clock-gdk.c index 2a5db8a44..03e37bf82 100644 --- a/clutter/gdk/clutter-master-clock-gdk.c +++ b/clutter/gdk/clutter-master-clock-gdk.c @@ -110,7 +110,7 @@ master_clock_schedule_forced_stages_updates (ClutterMasterClockGdk *master_clock g_hash_table_iter_init (&iter, master_clock->stage_to_clock); while (g_hash_table_iter_next (&iter, &stage, &frame_clock)) gdk_frame_clock_request_phase (GDK_FRAME_CLOCK (frame_clock), - GDK_FRAME_CLOCK_PHASE_UPDATE); + GDK_FRAME_CLOCK_PHASE_PAINT); } static void @@ -131,7 +131,7 @@ master_clock_schedule_stage_update (ClutterMasterClockGdk *master_clock, * we have no choice, we need to advance the timelines for the next * frame. */ if (master_clock->timelines != NULL) - gdk_frame_clock_request_phase (frame_clock, GDK_FRAME_CLOCK_PHASE_UPDATE); + gdk_frame_clock_request_phase (frame_clock, GDK_FRAME_CLOCK_PHASE_PAINT); } static void @@ -341,7 +341,7 @@ clutter_master_clock_gdk_add_stage_clock (ClutterMasterClockGdk *master_clock, g_hash_table_insert (master_clock->clock_to_stage, g_object_ref (frame_clock), g_list_append (NULL, stage)); - g_signal_connect (frame_clock, "update", + g_signal_connect (frame_clock, "paint", G_CALLBACK (clutter_master_clock_gdk_update), master_clock); } diff --git a/clutter/gdk/clutter-stage-gdk.c b/clutter/gdk/clutter-stage-gdk.c index ea4f05200..5cf394797 100644 --- a/clutter/gdk/clutter-stage-gdk.c +++ b/clutter/gdk/clutter-stage-gdk.c @@ -601,7 +601,7 @@ clutter_stage_gdk_schedule_update (ClutterStageWindow *stage_window, return; } - gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_UPDATE); + gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_PAINT); clutter_stage_window_parent_iface->schedule_update (stage_window, sync_delay); } |