[gnome-settings-daemon] xsettings: Shorten fontconfig timeout
- From: Behdad Esfahbod <behdad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] xsettings: Shorten fontconfig timeout
- Date: Sat, 2 May 2015 19:55:03 +0000 (UTC)
commit 9ac05a277804a387d7c33305e68071544ad05566
Author: Behdad Esfahbod <behdad behdad org>
Date: Sat May 2 15:47:39 2015 -0400
xsettings: Shorten fontconfig timeout
Change fontconfig timeout from 2 seconds to 200 milliseconds. This should
make font installations to be propagated to applications faster.
Originally I made this quite delayed, to make sure it doesn't fire too
much when people are installing packages, etc, but after many years, I think
that was a very bad choice.
Currently, it takes 4 seconds from when I "mv font.ttf ~/.fonts/" until
apps like gedit switching to it. Hopefully this change saves about
2.3 seconds of that (on average 0.5s was added by g_timeout_add_seconds()).
https://bugzilla.gnome.org/show_bug.cgi?id=748776
plugins/xsettings/fontconfig-monitor.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/xsettings/fontconfig-monitor.c b/plugins/xsettings/fontconfig-monitor.c
index 41e2aad..5647a2d 100644
--- a/plugins/xsettings/fontconfig-monitor.c
+++ b/plugins/xsettings/fontconfig-monitor.c
@@ -23,7 +23,7 @@
#include <gio/gio.h>
#include <fontconfig/fontconfig.h>
-#define TIMEOUT_SECONDS 2
+#define TIMEOUT_MILLISECONDS 200
static void
stuff_changed (GFileMonitor *monitor,
@@ -139,7 +139,7 @@ stuff_changed (GFileMonitor *monitor G_GNUC_UNUSED,
if (handle->timeout)
g_source_remove (handle->timeout);
- handle->timeout = g_timeout_add_seconds (TIMEOUT_SECONDS, update, data);
+ handle->timeout = g_timeout_add (TIMEOUT_MILLISECONDS, update, data);
g_source_set_name_by_id (handle->timeout, "[gnome-settings-daemon] update");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]