GNOME Bugzilla – Bug 544241
Add function to fill a GnomeBG with the schema defaults
Last modified: 2018-09-21 16:26:53 UTC
Patch attached to fill a GnomeBG with the schema defaults.
Created attachment 115052 [details] [review] Adds function gnome_bg_get_defaults
What's the use case? The name is probably bad and should be gnome_bg_load_from_defaults().
James, is there any chance that you incorporate Vincents comments?
Created attachment 151721 [details] [review] Reset to schema defaults if the image file is not found I had this patch lying around from a bug I was trying to fix: 1. Set your background to a picture on your home directory. 2. Move the picture file away. 3. Your background gets reset to a solid color, not to the default background on your system. Note that the intended behavior is "reset to the default background on your system". This is the vendor-supplied background, which usually appears in some GConf directory for defaults. It is *not*, however, the schema default. I couldn't find an easy way to use the vendor default instead of the schema default. My patch does the best it can to reset the background, however... it still needs work. I won't work on it further; feel free to do with this whatever you want :)
Things have changed a little bit, I pushed GSettings port to master yesterday. See bug 626021 for details. Not knowing about existence this bug, we kept previous behaviour, i.e. only show solid color (or gradient if set) when image file is moved away. The code for resetting background to vendor/system defaults lives in bug 626021#c12. Me and Bastien have found falling back to different background confusing for users. Vincent and you want the opposite. Fight :-) Anyway, with GSettings, vendor defaults come in form of overlay. I suppose g_settings_get_mapped () would try vendor settings before falling back to schema defaults. It's a nice and convenient way without workarounds. However, in contrast to your patch, it will only affect the "picture-filename" key, but adding a flag to use defaults for other keys is easy. Please let me know if you want to incorporate this fallback.
(In reply to comment #5) > > Not knowing about existence this bug, we kept previous behaviour, i.e. only > show solid color (or gradient if set) when image file is moved away. The code > for resetting background to vendor/system defaults lives in bug 626021#c12. Me > and Bastien have found falling back to different background confusing for > users. Vincent and you want the opposite. Fight :-) My ideal situation would be something like this: 1. You set a background image. 2. You move the image file away. 3. The background changes to the vendor's default, with a "broken image" icon in the center of the screen and some text to say "kittens.jpg not found" or something. Then that would give you a clue for why the background you expected isn't shown. I don't think the code should ever change the user's configuration keys by itself if it can't find the image file. It should keep the same values, but actually display something with the "broken image" icon overlaid on top.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-desktop/issues/19.