Gio.Settings on MS Windows

I found an old blog from 2017 mentioning that the registry is the backend used by Gio.Settings on Windows.
Is this still the case (registry is really a bad choice)?
If yes, how is the application ID (e.g. mapped to a registry location?

Also, how can I make a particular key Windows only? This is especially for the key storing window positions and size. I read a few posts here suggesting that its not the application responsibility to store its TLW co-ordinates on Linux.

By default they will just be stored under HKEY_CURRENT_USER\Software\GSettings\.

Note that it is the path that determines where the setting is stored, not the app id. So if your schema path was /org/google/maps then that would be in HKEY_CURRENT_USER\Software\GSettings\org\google\maps.

However in glib 2.78 it looks like you will be able to customize the root path by calling g_registry_settings_backend_new with a custom key, but that will not be out for another few months.

1 Like

I don’t believe you can. You probably just need to declare these data in your schema unconditionally, and just avoid using them in cases where you don’t want to. I don’t think GSettings has any concept of conditionality to assist.

From GTK4, window positions can’t be set by the toolkit anymore (in short, ‘because Wayland’), so I you will need to have platform-specific / conditional code to handle that kind of thing now. (No, I wasn’t delighted about this either, and guess I will just lose that feature, as I don’t care about it enough to start adding platform-dependent code. :slightly_frowning_face: )

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.