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
This commit is contained in:
Lionel Landwerlin 2015-09-11 13:15:16 +02:00
parent 5d83260b19
commit cb4e88884b
2 changed files with 4 additions and 4 deletions

View File

@ -110,7 +110,7 @@ master_clock_schedule_forced_stages_updates (ClutterMasterClockGdk *master_clock
g_hash_table_iter_init (&iter, master_clock->stage_to_clock); g_hash_table_iter_init (&iter, master_clock->stage_to_clock);
while (g_hash_table_iter_next (&iter, &stage, &frame_clock)) while (g_hash_table_iter_next (&iter, &stage, &frame_clock))
gdk_frame_clock_request_phase (GDK_FRAME_CLOCK (frame_clock), gdk_frame_clock_request_phase (GDK_FRAME_CLOCK (frame_clock),
GDK_FRAME_CLOCK_PHASE_UPDATE); GDK_FRAME_CLOCK_PHASE_PAINT);
} }
static void 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 * we have no choice, we need to advance the timelines for the next
* frame. */ * frame. */
if (master_clock->timelines != NULL) 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 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_hash_table_insert (master_clock->clock_to_stage, g_object_ref (frame_clock),
g_list_append (NULL, stage)); g_list_append (NULL, stage));
g_signal_connect (frame_clock, "update", g_signal_connect (frame_clock, "paint",
G_CALLBACK (clutter_master_clock_gdk_update), G_CALLBACK (clutter_master_clock_gdk_update),
master_clock); master_clock);
} }

View File

@ -601,7 +601,7 @@ clutter_stage_gdk_schedule_update (ClutterStageWindow *stage_window,
return; 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); clutter_stage_window_parent_iface->schedule_update (stage_window, sync_delay);
} }