[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - vcl/inc vcl/unx
Michael Meeks
michael.meeks at suse.com
Tue Jun 18 11:54:17 PDT 2013
vcl/inc/unx/gtk/gtkgdi.hxx | 4 +++
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 37 +++++++++++++++++++++++++------
2 files changed, 35 insertions(+), 6 deletions(-)
New commits:
commit c5e55de0845e16896444e2e01a99c9a7055bc868
Author: Michael Meeks <michael.meeks at suse.com>
Date: Tue Jun 18 18:01:30 2013 +0100
fdo#60565 - re-read font data on GtkSettings fontconfig-timestamp notify.
Change-Id: If1c4d3a7754cc35208e40494828a799f94f26afc
Reviewed-on: https://gerrit.libreoffice.org/4347
Reviewed-by: Noel Power <noel.power at suse.com>
Tested-by: Noel Power <noel.power at suse.com>
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index d41713a..8351adc 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -55,6 +55,8 @@ public:
Rectangle &rNativeBoundingRegion,
Rectangle &rNativeContentRegion );
void updateSettings( AllSettings& rSettings );
+ static void refreshFontconfig( GtkSettings *pSettings );
+ static void signalSettingsNotify( GObject*, GParamSpec *pSpec, gpointer );
private:
GtkWidget *mpWindow;
static GtkStyleContext *mpButtonStyle;
@@ -139,6 +141,8 @@ public:
//helper methods for frame's UpdateSettings
void updateSettings( AllSettings& rSettings );
+ static void refreshFontconfig( GtkSettings *pSettings );
+ static void signalSettingsNotify( GObject*, GParamSpec *pSpec, gpointer );
virtual bool setClipRegion( const Region& );
virtual void ResetClipRegion();
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 0a0fe89..370a406 100755
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3739,14 +3739,16 @@ void printStyleColors( GtkStyle* pStyle )
}
#endif
-void GtkSalGraphics::updateSettings( AllSettings& rSettings )
+void GtkSalGraphics::signalSettingsNotify( GObject *pSettings, GParamSpec *pSpec, gpointer )
{
- GdkScreen* pScreen = gtk_widget_get_screen( m_pWindow );
- gtk_widget_ensure_style( m_pWindow );
- GtkStyle* pStyle = gtk_widget_get_style( m_pWindow );
- GtkSettings* pSettings = gtk_widget_get_settings( m_pWindow );
- StyleSettings aStyleSet = rSettings.GetStyleSettings();
+ g_return_if_fail( pSpec != NULL );
+ if( !strcmp( pSpec->name, "gtk-fontconfig-timestamp" ) )
+ GtkSalGraphics::refreshFontconfig( GTK_SETTINGS( pSettings ) );
+}
+
+void GtkSalGraphics::refreshFontconfig( GtkSettings *pSettings )
+{
guint latest_fontconfig_timestamp = 0;
static guint our_fontconfig_timestamp = 0;
g_object_get( pSettings, "gtk-fontconfig-timestamp", &latest_fontconfig_timestamp, (char *)NULL );
@@ -3755,9 +3757,32 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
bool bFirstTime = our_fontconfig_timestamp == 0;
our_fontconfig_timestamp = latest_fontconfig_timestamp;
if (!bFirstTime)
+ {
psp::PrintFontManager::get().initialize();
+ }
+ }
+}
+
+void GtkSalGraphics::updateSettings( AllSettings& rSettings )
+{
+ GdkScreen* pScreen = gtk_widget_get_screen( m_pWindow );
+ gtk_widget_ensure_style( m_pWindow );
+ GtkStyle* pStyle = gtk_widget_get_style( m_pWindow );
+ GtkSettings* pSettings = gtk_widget_get_settings( m_pWindow );
+ StyleSettings aStyleSet = rSettings.GetStyleSettings();
+
+ // Listen for font changes
+ if( !g_object_get_data( G_OBJECT( pSettings ), "libo:listening" ) )
+ {
+ g_object_set_data( G_OBJECT( pSettings ), "libo:listening",
+ GUINT_TO_POINTER( 1 ) );
+ g_signal_connect_data( G_OBJECT( pSettings ), "notify",
+ G_CALLBACK( signalSettingsNotify ),
+ NULL, NULL, G_CONNECT_AFTER );
}
+ refreshFontconfig( pSettings );
+
// get the widgets in place
NWEnsureGTKMenu( m_nXScreen );
NWEnsureGTKMenubar( m_nXScreen );
More information about the Libreoffice-commits
mailing list