vte r2169 - in trunk: . src



Author: chpe
Date: Sat Nov 22 13:45:01 2008
New Revision: 2169
URL: http://svn.gnome.org/viewvc/vte?rev=2169&view=rev

Log:
Use gdk_threads_add_timeout_seconds() here.

Modified:
   trunk/ChangeLog
   trunk/src/vtepangocairo.c

Modified: trunk/src/vtepangocairo.c
==============================================================================
--- trunk/src/vtepangocairo.c	(original)
+++ trunk/src/vtepangocairo.c	Sat Nov 22 13:45:01 2008
@@ -17,7 +17,7 @@
  */
 
 
-#include "../config.h"
+#include <config.h>
 
 #include <sys/param.h>
 #include <string.h>
@@ -32,6 +32,8 @@
 #include <pango/pangocairo.h>
 #include <glib/gi18n-lib.h>
 
+#define FONT_CACHE_TIMEOUT (30) /* seconds */
+
 #undef VTEPANGOCAIRO_PROFILE
 
 
@@ -403,13 +405,9 @@
 static gboolean
 font_info_destroy_delayed (struct font_info *info)
 {
-	GDK_THREADS_ENTER ();
-
 	font_info_unregister (info);
 	font_info_free (info);
 
-	GDK_THREADS_LEAVE ();
-
 	return FALSE;
 }
 
@@ -426,9 +424,13 @@
 		return;
 
 	/* Delay destruction by a few seconds, in case we need it again */
-	info->destroy_timeout = g_timeout_add_seconds (30,
-						       (GSourceFunc) font_info_destroy_delayed,
-						       info);
+#if GTK_CHECK_VERSION (2, 14, 0)
+	info->destroy_timeout = gdk_threads_add_timeout_seconds (FONT_CACHE_TIMEOUT,
+#else
+	info->destroy_timeout = gdk_threads_add_timeout (FONT_CACHE_TIMEOUT * 1000,
+#endif
+								 (GSourceFunc) font_info_destroy_delayed,
+								 info);
 }
 
 static guint



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