[gnome-settings-daemon] background: Remove 8 second timeout when drawing background
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] background: Remove 8 second timeout when drawing background
- Date: Fri, 11 Mar 2011 19:30:14 +0000 (UTC)
commit fcf06249ee2cde3e1a7d0fe5bc800edd3bc88818
Author: Bastien Nocera <hadess hadess net>
Date: Fri Mar 11 19:28:37 2011 +0000
background: Remove 8 second timeout when drawing background
SessionRunning should now be right, and if it isn't, then we
only break on people that want nautilus to manage the background
window which it doesn't do by default.
https://bugzilla.gnome.org/show_bug.cgi?id=568588
plugins/background/gsd-background-manager.c | 37 +++------------------------
1 files changed, 4 insertions(+), 33 deletions(-)
---
diff --git a/plugins/background/gsd-background-manager.c b/plugins/background/gsd-background-manager.c
index 1837d5a..4705f9b 100644
--- a/plugins/background/gsd-background-manager.c
+++ b/plugins/background/gsd-background-manager.c
@@ -51,7 +51,6 @@ struct GsdBackgroundManagerPrivate
{
GSettings *settings;
GnomeBG *bg;
- guint timeout_id;
GnomeBGCrossfade *fade;
@@ -299,34 +298,11 @@ setup_bg (GsdBackgroundManager *manager)
manager->priv->settings);
}
-static gboolean
-queue_draw_background (GsdBackgroundManager *manager)
+static void
+setup_bg_and_draw_background (GsdBackgroundManager *manager)
{
- manager->priv->timeout_id = 0;
-
setup_bg (manager);
draw_background (manager, FALSE);
-
- return FALSE;
-}
-
-static void
-queue_timeout (GsdBackgroundManager *manager)
-{
- if (manager->priv->timeout_id > 0)
- return;
-
- /* If the session finishes then check if nautilus is
- * running and if not, set the background.
- *
- * We wait a few seconds after the session is up
- * because nautilus tells the session manager that its
- * ready before it sets the background.
- */
- manager->priv->timeout_id = g_timeout_add_seconds (8,
- (GSourceFunc)
- queue_draw_background,
- manager);
}
static void
@@ -349,7 +325,7 @@ on_session_manager_signal (GDBusProxy *proxy,
GsdBackgroundManager *manager = GSD_BACKGROUND_MANAGER (user_data);
if (g_strcmp0 (signal_name, "SessionRunning") == 0) {
- queue_timeout (manager);
+ setup_bg_and_draw_background (manager);
disconnect_session_manager_listener (manager);
}
}
@@ -433,7 +409,7 @@ draw_background_changed (GSettings *settings,
GsdBackgroundManager *manager)
{
if (dont_draw_background (manager) == FALSE)
- queue_timeout (manager);
+ setup_bg_and_draw_background (manager);
}
gboolean
@@ -493,11 +469,6 @@ gsd_background_manager_stop (GsdBackgroundManager *manager)
p->settings = NULL;
}
- if (p->timeout_id != 0) {
- g_source_remove (p->timeout_id);
- p->timeout_id = 0;
- }
-
if (p->bg != NULL) {
g_object_unref (p->bg);
p->bg = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]