[goocanvas] removed use of GDK_THREADS_ENTER/LEAVE()



commit 78db19483bc4c37f85c9172fe82e57501eeb4f42
Author: Damon Chaplin <Damon A Chaplin gmail com>
Date:   Wed Dec 14 17:34:10 2016 +0000

    removed use of GDK_THREADS_ENTER/LEAVE()

 ChangeLog           |   11 +++++++++++
 src/goocanvas.c     |    6 +-----
 src/goocanvasitem.c |   10 +++-------
 3 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4fd2069..35eba77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2016-12-14  Damon Chaplin  <damon localhost lan>
+
+       * src/goocanvas.c (goo_canvas_request_update): use
+       gdk_threads_add_idle_full() instead of g_idle_add_full().
+       (goo_canvas_idle_handler): remove GDK_THREADS_ENTER/LEAVE().
+       I think this is what we are supposed to do now, but I'm not sure!
+
+       * src/goocanvasitem.c (_goo_canvas_item_animate_internal): use
+       gdk_threads_add_timeout() instead of g_timeout_add().
+       (goo_canvas_item_animate_cb): remove GDK_THREADS_ENTER/LEAVE().
+
 2016-12-13  Damon Chaplin  <damon localhost lan>
 
        * src/goocanvasutils.c (goo_canvas_create_path): added (element-type)
diff --git a/src/goocanvas.c b/src/goocanvas.c
index a5a3e51..673db95 100644
--- a/src/goocanvas.c
+++ b/src/goocanvas.c
@@ -2621,16 +2621,12 @@ goo_canvas_update (GooCanvas *canvas)
 static gint
 goo_canvas_idle_handler (GooCanvas *canvas)
 {
-  GDK_THREADS_ENTER ();
-
   goo_canvas_update (canvas);
 
   /* Reset idle id. Note that we do this after goo_canvas_update(), to
      make sure we don't schedule another idle handler while that is running. */
   canvas->idle_id = 0;
 
-  GDK_THREADS_LEAVE ();
-
   /* Return FALSE to remove the idle handler. */
   return FALSE;
 }
@@ -2660,7 +2656,7 @@ goo_canvas_request_update (GooCanvas   *canvas)
    * so the canvas state will be updated before allocating sizes & redrawing.
    */
   if (!canvas->idle_id)
-    canvas->idle_id = g_idle_add_full (GTK_PRIORITY_RESIZE - 5, (GSourceFunc) goo_canvas_idle_handler, 
canvas, NULL);
+    canvas->idle_id = gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE - 5, (GSourceFunc) 
goo_canvas_idle_handler, canvas, NULL);
 }
 
 
diff --git a/src/goocanvasitem.c b/src/goocanvasitem.c
index 3dad300..425a096 100644
--- a/src/goocanvasitem.c
+++ b/src/goocanvasitem.c
@@ -1284,8 +1284,6 @@ goo_canvas_item_animate_cb (GooCanvasItemAnimation *anim)
   gdouble scale;
   gint step;
 
-  GDK_THREADS_ENTER ();
-
   if (model)
     model_iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model);
   else
@@ -1362,8 +1360,6 @@ goo_canvas_item_animate_cb (GooCanvasItemAnimation *anim)
        iface->set_transform (item, &new_matrix);
     }
 
-  GDK_THREADS_LEAVE ();
-
   /* Return FALSE to remove the timeout handler when we are finished. */
   return keep_source;
 }
@@ -1444,9 +1440,9 @@ _goo_canvas_item_animate_internal (GooCanvasItem       *item,
   g_object_set_data_full (object, animation_key, anim,
                          (GDestroyNotify) goo_canvas_item_free_animation);
 
-  anim->timeout_id = g_timeout_add (step_time,
-                                   (GSourceFunc) goo_canvas_item_animate_cb,
-                                   anim);
+  anim->timeout_id = gdk_threads_add_timeout (step_time,
+                                             (GSourceFunc) goo_canvas_item_animate_cb,
+                                             anim);
 }
 
 


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