Avoiding g_settings API from failing if keys are not found

9 views
Skip to first unread message

Gonzalo Garramuño

unread,
May 21, 2024, 7:23:17 AMMay 21
to fltkc...@googlegroups.com
I build my application on Rocky Linux 8.9.  I try running it under a
fresh Ubuntu 22.04.4 LTS.

When I do, I get:

(mrv2:540344): GLib-GIO-ERROR **: 20:47:45.978: Settings schema
'org.gnome.settings-daemon.plugins.xsettings' does not contain a key
named 'antialiasing'
Trace/breakpoint trap (core dumped)

The work-around I am using is to:

sudo cp
/usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.xsettings.gschema.xml
/usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.xsettings.gschema.xml.bad

sudo nano
/usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.xsettings.gschema.xml

(remove lines 19 and 20)
    <   </schema>
    <   <schema
id="org.gnome.settings-daemon.plugins.xsettings.deprecated">


sudo glib-compile-schemas /usr/share/glib-2.0/schemas


However, when I reported the bug to the Gnome guys, they suggested the
following:

That being said, from what I know about the gsettings API it is
intentional that it aborts when accessing non-existing schemas/keys to
make sure default values are only defined in one place and won't go out
of sync. If you still want to use schemas you have no control over and
fall back to custom default values for cases where they don't exist on a
system, you can use g_settings_list_schemas and g_settings_list_keys to
check if they exist before trying to access them.


The g_settings API seems like it is commented out and was used in:

drivers/X11/Fl_X11_Screen_Driver.cxx

Manolo

unread,
May 21, 2024, 7:42:10 AMMay 21
to fltk.coredev
Is this an FLTK error?

Gonzalo Garramulo

unread,
May 21, 2024, 2:26:20 PMMay 21
to fltkc...@googlegroups.com

El 21/5/24 a las 08:42, Manolo escribió:
> Is this an FLTK error?

I thought it was at first, but I traced it to an backwards
incompatibility on libgtk-3 between Rocky Linux 8.9 and Ubuntu 22.04.4
LTS, as FLTK does not call g_settings (all code was commented out).

For more info, see:

https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/801

--
Gonzalo Garramuño
ggar...@gmail.com

Reply all
Reply to author
Forward
0 new messages