diff options
| author | Pieter van Prooijen | 2022-05-16 15:20:27 +0200 |
|---|---|---|
| committer | Po Lu | 2022-05-17 18:15:18 +0800 |
| commit | 1a6a4614ceb9d868ccef023973eb7d28aae85b97 (patch) | |
| tree | f258a3cda290404fdc52c76c2be5b689c5bd9da0 /src | |
| parent | e9ad64ef92e7e8292ba596a97e114cbc91c6faa3 (diff) | |
| download | emacs-1a6a4614ceb9d868ccef023973eb7d28aae85b97.tar.gz emacs-1a6a4614ceb9d868ccef023973eb7d28aae85b97.zip | |
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')
| -rw-r--r-- | src/xsettings.c | 17 |
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 | |||
| 206 | unsigned seen; | 206 | unsigned seen; |
| 207 | }; | 207 | }; |
| 208 | 208 | ||
| 209 | #ifdef HAVE_PGTK | ||
| 210 | /* The cairo font_options as obtained using gsettings. */ | ||
| 211 | static cairo_font_options_t *font_options; | ||
| 212 | #endif | ||
| 213 | |||
| 209 | #ifdef HAVE_GSETTINGS | 214 | #ifdef HAVE_GSETTINGS |
| 210 | #define GSETTINGS_SCHEMA "org.gnome.desktop.interface" | 215 | #define GSETTINGS_SCHEMA "org.gnome.desktop.interface" |
| 211 | #define GSETTINGS_TOOL_BAR_STYLE "toolbar-style" | 216 | #define GSETTINGS_TOOL_BAR_STYLE "toolbar-style" |
| @@ -225,11 +230,6 @@ struct xsettings | |||
| 225 | 230 | ||
| 226 | static GSettings *gsettings_client; | 231 | static GSettings *gsettings_client; |
| 227 | 232 | ||
| 228 | #ifdef HAVE_PGTK | ||
| 229 | |||
| 230 | /* The cairo font_options as obtained using gsettings. */ | ||
| 231 | static cairo_font_options_t *font_options; | ||
| 232 | |||
| 233 | static bool | 233 | static bool |
| 234 | xg_settings_key_valid_p (GSettings *settings, const char *key) | 234 | xg_settings_key_valid_p (GSettings *settings, const char *key) |
| 235 | { | 235 | { |
| @@ -253,6 +253,7 @@ xg_settings_key_valid_p (GSettings *settings, const char *key) | |||
| 253 | #endif | 253 | #endif |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | #ifdef HAVE_PGTK | ||
| 256 | /* Store an event for re-rendering of the fonts. */ | 257 | /* Store an event for re-rendering of the fonts. */ |
| 257 | static void | 258 | static void |
| 258 | store_font_options_changed (void) | 259 | store_font_options_changed (void) |
| @@ -1206,7 +1207,11 @@ xsettings_get_system_normal_font (void) | |||
| 1206 | cairo_font_options_t * | 1207 | cairo_font_options_t * |
| 1207 | xsettings_get_font_options (void) | 1208 | xsettings_get_font_options (void) |
| 1208 | { | 1209 | { |
| 1209 | return cairo_font_options_copy (font_options); | 1210 | if (font_options != NULL) |
| 1211 | return cairo_font_options_copy (font_options); | ||
| 1212 | else | ||
| 1213 | /* GSettings is not configured. */ | ||
| 1214 | return cairo_font_options_create (); | ||
| 1210 | } | 1215 | } |
| 1211 | #endif | 1216 | #endif |
| 1212 | 1217 | ||