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 628624 - Port desktop background stuff to GSettings and new gnome-bg API
Port desktop background stuff to GSettings and new gnome-bg API
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: background
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on: 630419
Blocks: 626021
 
 
Reported: 2010-09-02 16:08 UTC by Tomas Bzatek
Modified: 2011-09-29 14:21 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
proposed patch (9.42 KB, patch)
2010-09-02 16:08 UTC, Tomas Bzatek
reviewed Details | Review
patch (9.09 KB, patch)
2010-10-18 16:02 UTC, Tomas Bzatek
none Details | Review
patch (9.16 KB, patch)
2010-11-04 12:44 UTC, Tomas Bzatek
committed Details | Review

Description Tomas Bzatek 2010-09-02 16:08:53 UTC
Created attachment 169373 [details] [review]
proposed patch

In relation to new gnome-bg API introduced in bug 626021, this patch ports the current background module to GSettings. I've changed only the parts related to GConf, functionality remains unchanged.

I've added dependency on gsettings-desktop-schemas package as long as we use their schemas. We should probably add nautilus as well otherwise an attempt to access the 'org.gnome.nautilus.preferences' schema will fail. There's no way to conditionally check for schema existance, same issue as in GEdit.

Additionally, the existing code assumes that Nautilus is always present in the session and leave all background setting work on it if the 'show-desktop' key is set. Not sure what are the Gnome 3.0 plans, is this still valid?
Comment 1 Matthias Clasen 2010-09-30 22:20:58 UTC
Review of attachment 169373 [details] [review]:

::: plugins/background/gsd-background-manager.c
@@ +407,3 @@
 
+        manager->priv->settings = g_settings_new ("org.gnome.desktop.background");
+        manager->priv->nautilus_preferences = g_settings_new ("org.gnome.nautilus.preferences");

Does this work if nautilus is not installed ? With nautilus becoming less of a desktop component, and more of a regular application, that might be an issue. And it would be bad if g-s-d crashed in that case...
Comment 2 Tomas Bzatek 2010-10-01 09:39:35 UTC
(In reply to comment #1)
> Does this work if nautilus is not installed ? With nautilus becoming less of a
> desktop component, and more of a regular application, that might be an issue.
> And it would be bad if g-s-d crashed in that case...
No, it won't. With the classic desktop going away we discussed on irc that background handling should go to g-s-d only and be ripped out of nautilus completely, just like automounting. In fact, the code is somewhat duplicated here and in nautilus.

Perhaps we can add an automake check for nautilus and some ifdefs meanwhile...
Comment 3 Bastien Nocera 2010-10-05 09:38:26 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Does this work if nautilus is not installed ? With nautilus becoming less of a
> > desktop component, and more of a regular application, that might be an issue.
> > And it would be bad if g-s-d crashed in that case...
> No, it won't. With the classic desktop going away we discussed on irc that
> background handling should go to g-s-d only and be ripped out of nautilus
> completely, just like automounting. In fact, the code is somewhat duplicated
> here and in nautilus.
> 
> Perhaps we can add an automake check for nautilus and some ifdefs meanwhile...

No, it should only use org.gnome.desktop.background.

However you could do run-time checks of whether nautilus is running, and use those prefs, if really required.
Comment 4 Bastien Nocera 2010-10-12 14:00:43 UTC
(In reply to comment #3)
> However you could do run-time checks of whether nautilus is running, and use
> those prefs, if really required.

I would obviously prefer for nautilus to only use the preferences listed in gsettings-desktop-schemas, and add a preference there for the sake of nautilus.
Comment 5 Tomas Bzatek 2010-10-18 16:02:54 UTC
Created attachment 172620 [details] [review]
patch

(In reply to comment #4)
> (In reply to comment #3)
> > However you could do run-time checks of whether nautilus is running, and use
> > those prefs, if really required.
> 
> I would obviously prefer for nautilus to only use the preferences listed in
> gsettings-desktop-schemas, and add a preference there for the sake of nautilus.

Right, that seems to be better way than adding nautilus-specific hacks. I've splitted the settings and proposed their inclusion in gsettings-desktop-schemas - bug 632225.

Attached is updated patch, I've consolidated some callbacks and used the new 'show-desktop-icons' key. It should work the same way as before, i.e. doing nothing when nautilus is running or the key is set to TRUE, indicating that some file manager (as an integral part of the session) is set to be started.

We might want to modify this for Gnome 3 when file manager is kicked out of the session and nautilus becomes just a standalone app.
Comment 6 Tomas Bzatek 2010-11-04 12:44:55 UTC
Created attachment 173823 [details] [review]
patch

Little update for latest gnome-bg changes, only passing our GSettings object instance to gnome_bg_load_from_preferences().
Comment 7 Tomas Bzatek 2010-11-09 18:03:14 UTC
commit 23b50dfc7078b78a513598060ee22ae46c262534
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:   Tue Nov 9 19:01:19 2010 +0100

    Port backround module to GSettings
    
    See bug 628624 for details.
Comment 8 Javier Jardón (IRC: jjardon) 2011-09-29 13:59:38 UTC
Reopen as g-s-d still depends on gconf, from configure.ac:

dnl FIXME we link against gconf-2.0 until all the plugins are ported
dnl to GSettings, or we could get crashes on startup
Comment 9 Javier Jardón (IRC: jjardon) 2011-09-29 14:21:51 UTC
Sorry, close this again and follow discussion in bug #631502