After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 544241 - Add function to fill a GnomeBG with the schema defaults
Add function to fill a GnomeBG with the schema defaults
Status: RESOLVED OBSOLETE
Product: gnome-desktop
Classification: Core
Component: Background
git master
Other All
: Normal enhancement
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks: 48004 544242
 
 
Reported: 2008-07-22 21:53 UTC by James Sharpe
Modified: 2018-09-21 16:26 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Adds function gnome_bg_get_defaults (3.37 KB, patch)
2008-07-22 21:55 UTC, James Sharpe
none Details | Review
Reset to schema defaults if the image file is not found (4.53 KB, patch)
2010-01-18 22:18 UTC, Federico Mena Quintero
none Details | Review

Description James Sharpe 2008-07-22 21:53:57 UTC
Patch attached to fill a GnomeBG with the schema defaults.
Comment 1 James Sharpe 2008-07-22 21:55:14 UTC
Created attachment 115052 [details] [review]
Adds function gnome_bg_get_defaults
Comment 2 Vincent Untz 2008-12-05 15:20:29 UTC
What's the use case? The name is probably bad and should be gnome_bg_load_from_defaults().
Comment 3 Tobias Mueller 2009-09-12 15:43:25 UTC
James, is there any chance that you incorporate Vincents comments?
Comment 4 Federico Mena Quintero 2010-01-18 22:18:18 UTC
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 :)
Comment 5 Tomas Bzatek 2010-11-10 10:03:24 UTC
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.
Comment 6 Federico Mena Quintero 2010-11-16 16:13:43 UTC
(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.
Comment 7 GNOME Infrastructure Team 2018-09-21 16:26:53 UTC
-- 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.