[gnome-settings-daemon] background: always check if Nautilus is running
- From: Tomas Bzatek <tbzatek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] background: always check if Nautilus is running
- Date: Tue, 7 Dec 2010 15:41:40 +0000 (UTC)
commit d22b75db508a792e3786a2011b707e930a0f0355
Author: Tomas Bzatek <tbzatek redhat com>
Date: Tue Dec 7 16:24:19 2010 +0100
background: always check if Nautilus is running
This changes the way we detect that Nautilus is managing desktop.
We can no longer rely on having Nautilus a key component in the session.
See bug 636191 for details.
plugins/background/gsd-background-manager.c | 34 ++++++++++++---------------
1 files changed, 15 insertions(+), 19 deletions(-)
---
diff --git a/plugins/background/gsd-background-manager.c b/plugins/background/gsd-background-manager.c
index 9d42449..d4010b7 100644
--- a/plugins/background/gsd-background-manager.c
+++ b/plugins/background/gsd-background-manager.c
@@ -68,7 +68,7 @@ G_DEFINE_TYPE (GsdBackgroundManager, gsd_background_manager, G_TYPE_OBJECT)
static gpointer manager_object = NULL;
static gboolean
-nautilus_is_running (void)
+nautilus_is_drawing_background (GsdBackgroundManager *manager)
{
Atom window_id_atom;
Window nautilus_xid;
@@ -81,6 +81,13 @@ nautilus_is_running (void)
Atom wmclass_atom;
gboolean running;
gint error;
+ gboolean show_desktop_icons;
+
+ show_desktop_icons = g_settings_get_boolean (manager->priv->settings,
+ "show-desktop-icons");
+ if (! show_desktop_icons) {
+ return FALSE;
+ }
window_id_atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
"NAUTILUS_DESKTOP_WINDOW_ID", True);
@@ -166,7 +173,8 @@ draw_background (GsdBackgroundManager *manager,
int n_screens;
int i;
- if (nautilus_is_running ()) {
+
+ if (nautilus_is_drawing_background (manager)) {
return;
}
@@ -217,20 +225,9 @@ static void
background_changed (GsdBackgroundManager *manager,
gboolean use_crossfade)
{
- gboolean show_desktop_icons;
-
- show_desktop_icons = g_settings_get_boolean (manager->priv->settings,
- "show-desktop-icons");
-
- if (!nautilus_is_running () || !show_desktop_icons) {
- if (manager->priv->bg == NULL) {
- setup_bg (manager);
- } else {
- gnome_bg_load_from_preferences (manager->priv->bg,
- manager->priv->settings);
- }
- draw_background (manager, use_crossfade);
- }
+ gnome_bg_load_from_preferences (manager->priv->bg,
+ manager->priv->settings);
+ draw_background (manager, use_crossfade);
}
static gboolean
@@ -280,11 +277,10 @@ static gboolean
queue_draw_background (GsdBackgroundManager *manager)
{
manager->priv->timeout_id = 0;
- if (nautilus_is_running ()) {
- return FALSE;
- }
+
setup_bg (manager);
draw_background (manager, FALSE);
+
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]