Subject: Re: bug#74383: 29.4; Emacs PGTK crashes on Void Linux

From: Taha Aziz Ben Ali <[email-masked]>
Date: Sun, 17 Nov 2024 14:08:50 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Taha Aziz Ben Ali <[email-masked]>
>> Cc: [email-masked], [email-masked]
>> Date: Sun, 17 Nov 2024 13:23:43 +0100
>> 
>> I found this answer [3] which uses "gsettings" and as far as I know,
>> settings changed through gsettings do not affect Emacs, so I have to
>> create a stylesheet just as the manual says.
>> 
>> Any pointers?
>
> See src/xsettings.c, I hope this is relevant to your case (but I know
> nothing about GTK, so apologies if this makes no sense).

It's very relevant and the source code is actually really insightful.

Line 219:

   #ifdef HAVE_GSETTINGS
   #define GSETTINGS_SCHEMA         "org.gnome.desktop.interface"
   #define GSETTINGS_TOOL_BAR_STYLE "toolbar-style"

Well, according to `system-configuration-features', gsettings is configured:

"ACL ... GSETTINGS HARFBUZZ ..."

So GSETTINGS is indeed considered, let's see the value of my setting
outside of Emacs:

   $ gsettings get org.gnome.desktop.interface toolbar-style
   => 'text'

According to https://docs.gtk.org/gtk3/enum.ToolbarStyle.html, the
"text" style corresponds to the value "1".

Line 1080-1088:

    val = g_settings_get_value (gsettings_client, GSETTINGS_TOOL_BAR_STYLE);
      if (val)
        {
          g_variant_ref_sink (val);
          if (g_variant_is_of_type (val, G_VARIANT_TYPE_STRING))
            current_tool_bar_style
              = map_tool_bar_style (g_variant_get_string (val, NULL));
          g_variant_unref (val);
        }

Okay, but `(tool-bar-get-system-style)' actually returns "image"... huh?

Docstring says "image" is the fallback return value... Why is the
mapping not being handled correctly?