summaryrefslogtreecommitdiff
path: root/src/xsettings.c
diff options
context:
space:
mode:
authorPieter van Prooijen <pieter.van.prooijen@teloden.nl>2022-05-16 15:20:27 +0200
committerPo Lu <luangruo@yahoo.com>2022-05-17 18:15:18 +0800
commit1a6a4614ceb9d868ccef023973eb7d28aae85b97 (patch)
treef258a3cda290404fdc52c76c2be5b689c5bd9da0 /src/xsettings.c
parente9ad64ef92e7e8292ba596a97e114cbc91c6faa3 (diff)
downloademacs-1a6a4614ceb9d868ccef023973eb7d28aae85b97.tar.gz
Fix font options compilation with gsettings disabled
* src/xsettings.c (xsettings_get_font_options): Return a font_options even if gsettings is not enabled.
Diffstat (limited to 'src/xsettings.c')
-rw-r--r--src/xsettings.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/xsettings.c b/src/xsettings.c
index 2e33ef958ac..45341d8ebd5 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -206,6 +206,11 @@ struct xsettings
unsigned seen;
};
+#ifdef HAVE_PGTK
+/* The cairo font_options as obtained using gsettings. */
+static cairo_font_options_t *font_options;
+#endif
+
#ifdef HAVE_GSETTINGS
#define GSETTINGS_SCHEMA "org.gnome.desktop.interface"
#define GSETTINGS_TOOL_BAR_STYLE "toolbar-style"
@@ -225,11 +230,6 @@ struct xsettings
static GSettings *gsettings_client;
-#ifdef HAVE_PGTK
-
-/* The cairo font_options as obtained using gsettings. */
-static cairo_font_options_t *font_options;
-
static bool
xg_settings_key_valid_p (GSettings *settings, const char *key)
{
@@ -253,6 +253,7 @@ xg_settings_key_valid_p (GSettings *settings, const char *key)
#endif
}
+#ifdef HAVE_PGTK
/* Store an event for re-rendering of the fonts. */
static void
store_font_options_changed (void)
@@ -1206,7 +1207,11 @@ xsettings_get_system_normal_font (void)
cairo_font_options_t *
xsettings_get_font_options (void)
{
- return cairo_font_options_copy (font_options);
+ if (font_options != NULL)
+ return cairo_font_options_copy (font_options);
+ else
+ /* GSettings is not configured. */
+ return cairo_font_options_create ();
}
#endif