summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2015-05-02 15:47:39 -0400
committerBehdad Esfahbod <behdad@behdad.org>2015-05-02 15:54:28 -0400
commit9ac05a277804a387d7c33305e68071544ad05566 (patch)
tree96c8afb134cbb2e692275d3faa1c2db1ec84dcc3
parent015f050724ac89422abeb1448b9e95ab74e82801 (diff)
downloadgnome-settings-daemon-9ac05a277804a387d7c33305e68071544ad05566.tar.gz
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
-rw-r--r--plugins/xsettings/fontconfig-monitor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/xsettings/fontconfig-monitor.c b/plugins/xsettings/fontconfig-monitor.c
index 41e2aad2..5647a2dc 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");
}