diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-09-03 16:15:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-03 17:01:38 +0100 |
commit | feddd3d87077abb2d5435804a9a4859286f6d86f (patch) | |
tree | fe5d61ee70ac4f940c33b61bdfca67bbf7b9a000 /vcl/unx | |
parent | 402603793360fb058f84e2aa88d5fdcd6131334d (diff) |
Refetch fonts if new ones installed or old ones deinstalled
i.e. honour gtk-fontconfig-timestamp so that if we request a font from
packagekit to be installed, then we can auto-use it when it appears.
Change-Id: Id0d914a3f9cd589d9e8a87bf9be4b6e47de2e191
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/gdi/salgdi3.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 89e524e443c9..a532fc239e32 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -573,7 +573,11 @@ bool X11SalGraphics::AddTempDevFont( ImplDevFontList* pFontList, return true; } -// ---------------------------------------------------------------------------- +void X11SalGraphics::ClearDevFontCache() +{ + X11GlyphCache& rGC = X11GlyphCache::GetInstance(); + rGC.ClearFontCache(); +} void X11SalGraphics::GetDevFontList( ImplDevFontList *pList ) { diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 011e755a51a9..da3cc507ddc7 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -3699,6 +3699,17 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) GtkSettings* pSettings = gtk_widget_get_settings( m_pWindow ); StyleSettings aStyleSet = rSettings.GetStyleSettings(); + guint latest_fontconfig_timestamp = 0; + static guint our_fontconfig_timestamp = 0; + g_object_get( pSettings, "gtk-fontconfig-timestamp", &latest_fontconfig_timestamp, (char *)NULL ); + if (latest_fontconfig_timestamp != our_fontconfig_timestamp) + { + bool bFirstTime = our_fontconfig_timestamp == 0; + our_fontconfig_timestamp = latest_fontconfig_timestamp; + if (!bFirstTime) + psp::PrintFontManager::get().initialize(); + } + // get the widgets in place NWEnsureGTKMenu( m_nXScreen ); NWEnsureGTKMenubar( m_nXScreen ); |