Wayland implementation of gdk_screen_get_setting() can give inconsistent results for confined/sandboxed applications
Under Wayland, various settings like gtk-theme-name
are mapped to GSettings keys.
Sandboxing systems like Flatpak and Snap generally make these settings visible to confined apps by giving them access to the user's dconf database. However if the user has not modified the setting, then the result will depend on the gsettings schemas + overrides.
The schemas and overrides provided by the sandbox runtime are not necessarily the same as those of the host system. As a concrete example, if you have a distribution that changes the default theme through a .override
file in /usr/share/glib-2.0/schemas
and the sandbox runtime does not include the override, then the sandboxed app will pick a different theme.