diff options
Diffstat (limited to 'src/gpm-idle.c')
-rw-r--r-- | src/gpm-idle.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gpm-idle.c b/src/gpm-idle.c index a7132fa..d2e92e0 100644 --- a/src/gpm-idle.c +++ b/src/gpm-idle.c @@ -36,7 +36,6 @@ #include <glib.h> #include <glib/gi18n.h> -#include <gtk/gtk.h> #include "egg-debug.h" #include "egg-idletime.h" @@ -227,7 +226,9 @@ gpm_idle_evaluate (GpmIdle *idle) if (idle->priv->timeout_blank_id == 0 && idle->priv->timeout_blank != 0) { egg_debug ("setting up blank callback for %is", idle->priv->timeout_blank); - idle->priv->timeout_blank_id = g_timeout_add_seconds (idle->priv->timeout_blank, (GSourceFunc) gpm_idle_blank_cb, idle); + idle->priv->timeout_blank_id = g_timeout_add_seconds (idle->priv->timeout_blank, + (GSourceFunc) gpm_idle_blank_cb, idle); + g_source_set_name_by_id (idle->priv->timeout_blank_id, "[GpmIdle] blank"); } /* are we inhibited from sleeping */ @@ -242,7 +243,9 @@ gpm_idle_evaluate (GpmIdle *idle) if (idle->priv->timeout_sleep_id == 0 && idle->priv->timeout_sleep != 0) { egg_debug ("setting up sleep callback %is", idle->priv->timeout_sleep); - idle->priv->timeout_sleep_id = g_timeout_add_seconds (idle->priv->timeout_sleep, (GSourceFunc) gpm_idle_sleep_cb, idle); + idle->priv->timeout_sleep_id = g_timeout_add_seconds (idle->priv->timeout_sleep, + (GSourceFunc) gpm_idle_sleep_cb, idle); + g_source_set_name_by_id (idle->priv->timeout_sleep_id, "[GpmIdle] sleep"); } } out: @@ -411,10 +414,15 @@ gpm_idle_finalize (GObject *object) g_return_if_fail (idle->priv != NULL); - if (idle->priv->timeout_blank_id != 0) + if (idle->priv->timeout_blank_id != 0) { g_source_remove (idle->priv->timeout_blank_id); - if (idle->priv->timeout_sleep_id != 0) + idle->priv->timeout_blank_id = 0; + } + + if (idle->priv->timeout_sleep_id != 0) { g_source_remove (idle->priv->timeout_sleep_id); + idle->priv->timeout_sleep_id = 0; + } g_object_unref (idle->priv->load); g_object_unref (idle->priv->session); |