summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/gtksalframe.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/gtk/gtksalframe.cxx')
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 9e14746d3635..29f7eb93b3a7 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -3289,7 +3289,21 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram
// so post user event to safely dispatch the SALEVENT_SETTINGSCHANGED
// note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_SETTINGSCHANGED );
- GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_FONTCHANGED );
+
+ // fire off font-changed when the system cairo font hints change
+ GtkInstance *pInstance = static_cast<GtkInstance*>(GetSalData()->m_pInstance);
+ const cairo_font_options_t* pLastCairoFontOptions = pInstance->GetLastSeenCairoFontOptions();
+ const cairo_font_options_t* pCurrentCairoFontOptions = gdk_screen_get_font_options(gdk_screen_get_default());
+ bool bFontSettingsChanged = true;
+ if (pLastCairoFontOptions && pCurrentCairoFontOptions)
+ bFontSettingsChanged = !cairo_font_options_equal(pLastCairoFontOptions, pCurrentCairoFontOptions);
+ else if (!pLastCairoFontOptions && !pCurrentCairoFontOptions)
+ bFontSettingsChanged = false;
+ if (bFontSettingsChanged)
+ {
+ pInstance->ResetLastSeenCairoFontOptions();
+ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_FONTCHANGED );
+ }
}
/* #i64117# gtk sets a nice background pixmap