After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748776 - Shorten fontconfig timeout
Shorten fontconfig timeout
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2015-05-01 22:00 UTC by Behdad Esfahbod
Modified: 2015-05-06 19:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (814 bytes, patch)
2015-05-01 22:00 UTC, Behdad Esfahbod
reviewed Details | Review

Description Behdad Esfahbod 2015-05-01 22:00:53 UTC
Created attachment 302740 [details] [review]
patch

Please 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.

Patch attached.  Thanks.
Comment 1 Bastien Nocera 2015-05-02 11:51:48 UTC
Review of attachment 302740 [details] [review]:

We'll need a git-formatted patch before committing it, with the info you gave in the bug comment. Otherwise looks good, even to backport.
Comment 2 Behdad Esfahbod 2015-05-02 19:55:23 UTC
Thanks Bastien.  Pushed to master.  Please cherry-pick to branches as you see fit.

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
Comment 3 Behdad Esfahbod 2015-05-04 20:17:04 UTC
Reopening.

I did some more testing, and think I can remove the timeout completely.  Please see this sample commit:

https://github.com/behdad/fontconfig-monitor/commit/f2e44c3d4df60864687d42eee10a0123ce50c247

(I copied fontconfig-monitor into its own repo to make testing with it easier.  I can add a pointer to the copy in gsd if you find that useful.

Let me know how it looks and I'll push it to master.

Thanks.
Comment 4 Bastien Nocera 2015-05-06 09:50:09 UTC
(In reply to Behdad Esfahbod from comment #3)
> Reopening.
> 
> I did some more testing, and think I can remove the timeout completely. 
> Please see this sample commit:
> 
> https://github.com/behdad/fontconfig-monitor/commit/
> f2e44c3d4df60864687d42eee10a0123ce50c247
> 
> (I copied fontconfig-monitor into its own repo to make testing with it
> easier.  I can add a pointer to the copy in gsd if you find that useful.
> 
> Let me know how it looks and I'll push it to master.

Looks fine. But I'd really rather I didn't have to jump through hoops to apply this patch. I've fixed up the patch and commit messages and applied it to master and gnome-3-14.
Comment 5 Behdad Esfahbod 2015-05-06 19:15:34 UTC
Thanks Bastien.