[clutter] gdk: master clock: hook ourselves to the paint signal



commit cb4e88884bc811120dabcf473503d23a21044618
Author: Lionel Landwerlin <llandwerlin gmail com>
Date:   Fri Sep 11 13:15:16 2015 +0200

    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

 clutter/gdk/clutter-master-clock-gdk.c |    6 +++---
 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 2a5db8a..03e37bf 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 ea4f052..5cf3947 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);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]