Subject: bug#55463: closed (Re: bug#55463: [PATCH] Fix font options compilation with gsettings disabled)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 17 May 2022 10:17:02 +0000

Your bug report

#55463: [PATCH] Fix font options compilation with gsettings disabled

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
55463: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55463
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#55463: [PATCH] Fix font options compilation with gsettings disabled
From: Po Lu <[email-masked]>
To: Pieter van Prooijen <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Tue, 17 May 2022 18:15:43 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Pieter van Prooijen <[email-masked]> writes:

> Hi, 
>
> I've reverted the change in the comment, here's the patch without that
> change.

Now installed, so I'm closing this bug.  Thanks.

Subject: [PATCH] Fix font options compilation with gsettings disabled
From: Pieter van Prooijen <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Mon, 16 May 2022 22:22:23 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello All,

This is a small patch to make the recent gsettings font rendering
changes compile when pgtk is configured but gsettings is not.

Kind Regards,

Pieter van Prooijen

From 3c970748371f288d4068042e8cc6e7e7089040bd Mon Sep 17 00:00:00 2001
From: Pieter van Prooijen <[email-masked]>
Date: Mon, 16 May 2022 15:20:27 +0200
Subject: [PATCH] Fix font options compilation with gsettings disabled

* src/xsettings.c (xsettings_get_font_options): Return a font_options
even if gsettings is not enabled.
---
 src/xsettings.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/xsettings.c b/src/xsettings.c
index 2e33ef958a..53d8a25e16 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -206,6 +206,11 @@ #define XSETTINGS_TOOL_BAR_STYLE  "Gtk/ToolbarStyle"
   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 @@ #define GSETTINGS_FONT_HINTING       "font-hinting"
 
 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)
@@ -1200,13 +1201,17 @@ xsettings_get_system_normal_font (void)
 #endif
 
 #ifdef HAVE_PGTK
-/* Return the cairo font options, updated from the gsettings font
-   config entries.  The caller should call cairo_font_options_destroy
-   on the result.  */
+/* Return the cairo font options, optionally updated from the gsettings
+   font config entries.  The caller should call
+   cairo_font_options_destroy on the result.  */
 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
 
-- 
2.34.1