---
 src/Makefile.am       |    2 
 src/egg-console-kit.c |  363 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/egg-console-kit.h |   71 +++++++++
 src/gpm-backlight.c   |   18 ++
 src/gpm-control.c     |    6 
 src/gpm-manager.c     |   36 ++++
 6 files changed, 496 insertions(+)

--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -165,6 +165,8 @@
 	gpm-srv-screensaver.c				\
 	gpm-conf.h					\
 	gpm-conf.c					\
+	egg-console-kit.h				\
+	egg-console-kit.c				\
 	gpm-idle.h					\
 	gpm-idle.c					\
 	gpm-load.h					\
--- /dev/null
+++ b/src/egg-console-kit.c
@@ -0,0 +1,363 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2006-2008 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <glib.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus.h>
+
+#include "egg-debug.h"
+#include "egg-console-kit.h"
+
+static void     egg_console_kit_finalize	(GObject		*object);
+
+#define EGG_CONSOLE_KIT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_CONSOLE_KIT, EggConsoleKitPrivate))
+
+#define CONSOLEKIT_NAME			"org.freedesktop.ConsoleKit"
+#define CONSOLEKIT_PATH			"/org/freedesktop/ConsoleKit"
+#define CONSOLEKIT_INTERFACE		"org.freedesktop.ConsoleKit"
+
+#define CONSOLEKIT_MANAGER_PATH	 	"/org/freedesktop/ConsoleKit/Manager"
+#define CONSOLEKIT_MANAGER_INTERFACE    "org.freedesktop.ConsoleKit.Manager"
+#define CONSOLEKIT_SEAT_INTERFACE       "org.freedesktop.ConsoleKit.Seat"
+#define CONSOLEKIT_SESSION_INTERFACE    "org.freedesktop.ConsoleKit.Session"
+
+struct EggConsoleKitPrivate
+{
+	DBusGConnection		*connection;
+	DBusGProxy		*proxy_manager;
+	DBusGProxy		*proxy_session;
+	gchar			*session_id;
+};
+
+enum {
+	EGG_CONSOLE_KIT_ACTIVE_CHANGED,
+	EGG_CONSOLE_KIT_LAST_SIGNAL
+};
+
+static gpointer egg_console_kit_object = NULL;
+static guint signals [EGG_CONSOLE_KIT_LAST_SIGNAL] = { 0 };
+G_DEFINE_TYPE (EggConsoleKit, egg_console_kit, G_TYPE_OBJECT)
+
+/**
+ * egg_console_kit_restart:
+ **/
+gboolean
+egg_console_kit_restart (EggConsoleKit *console, GError **error)
+{
+	gboolean ret;
+	GError *error_local = NULL;
+
+	g_return_val_if_fail (EGG_IS_CONSOLE_KIT (console), FALSE);
+	g_return_val_if_fail (console->priv->proxy_manager != NULL, FALSE);
+
+	ret = dbus_g_proxy_call (console->priv->proxy_manager, "Restart", &error_local,
+				 G_TYPE_INVALID, G_TYPE_INVALID);
+	if (!ret) {
+		egg_warning ("Couldn't restart: %s", error_local->message);
+		if (error != NULL)
+			*error = g_error_new (1, 0, "%s", error_local->message);
+		g_error_free (error_local);
+	}
+	return ret;
+}
+
+/**
+ * egg_console_kit_stop:
+ **/
+gboolean
+egg_console_kit_stop (EggConsoleKit *console, GError **error)
+{
+	gboolean ret;
+	GError *error_local = NULL;
+
+	g_return_val_if_fail (EGG_IS_CONSOLE_KIT (console), FALSE);
+	g_return_val_if_fail (console->priv->proxy_manager != NULL, FALSE);
+
+	ret = dbus_g_proxy_call (console->priv->proxy_manager, "Stop", &error_local,
+				 G_TYPE_INVALID, G_TYPE_INVALID);
+	if (!ret) {
+		egg_warning ("Couldn't stop: %s", error_local->message);
+		if (error != NULL)
+			*error = g_error_new (1, 0, "%s", error_local->message);
+		g_error_free (error_local);
+	}
+	return ret;
+}
+
+/**
+ * egg_console_kit_can_stop:
+ **/
+gboolean
+egg_console_kit_can_stop (EggConsoleKit *console, gboolean *can_stop, GError **error)
+{
+	gboolean ret;
+	GError *error_local = NULL;
+
+	g_return_val_if_fail (EGG_IS_CONSOLE_KIT (console), FALSE);
+	g_return_val_if_fail (console->priv->proxy_manager != NULL, FALSE);
+
+	ret = dbus_g_proxy_call (console->priv->proxy_manager, "CanStop", &error_local,
+				 G_TYPE_INVALID,
+				 G_TYPE_BOOLEAN, can_stop, G_TYPE_INVALID);
+	if (!ret) {
+		egg_warning ("Couldn't do CanStop: %s", error_local->message);
+		if (error != NULL)
+			*error = g_error_new (1, 0, "%s", error_local->message);
+		g_error_free (error_local);
+		/* CanStop was only added in new versions of ConsoleKit,
+		 * so assume true if this failed */
+		*can_stop = TRUE;
+	}
+	return ret;
+}
+
+/**
+ * egg_console_kit_can_restart:
+ **/
+gboolean
+egg_console_kit_can_restart (EggConsoleKit *console, gboolean *can_restart, GError **error)
+{
+	gboolean ret;
+	GError *error_local = NULL;
+
+	g_return_val_if_fail (EGG_IS_CONSOLE_KIT (console), FALSE);
+	g_return_val_if_fail (console->priv->proxy_manager != NULL, FALSE);
+
+	ret = dbus_g_proxy_call (console->priv->proxy_manager, "CanRestart", &error_local,
+				 G_TYPE_INVALID,
+				 G_TYPE_BOOLEAN, can_restart, G_TYPE_INVALID);
+	if (!ret) {
+		egg_warning ("Couldn't do CanRestart: %s", error_local->message);
+		if (error != NULL)
+			*error = g_error_new (1, 0, "%s", error_local->message);
+		g_error_free (error_local);
+		/* CanRestart was only added in new versions of ConsoleKit,
+		 * so assume true if this failed */
+		*can_restart = TRUE;
+	}
+	return ret;
+}
+
+/**
+ * egg_console_kit_is_local:
+ *
+ * Return value: Returns whether the session is local
+ **/
+gboolean
+egg_console_kit_is_local (EggConsoleKit *console)
+{
+	gboolean ret = FALSE;
+	gboolean value = FALSE;
+	GError *error = NULL;
+
+	g_return_val_if_fail (EGG_IS_CONSOLE_KIT (console), FALSE);
+
+	/* maybe console kit does not know about our session */
+	if (console->priv->proxy_session == NULL) {
+		egg_warning ("no ConsoleKit session");
+		goto out;
+	}
+
+	/* is our session local */
+	ret = dbus_g_proxy_call (console->priv->proxy_session, "IsLocal", &error, G_TYPE_INVALID,
+				 G_TYPE_BOOLEAN, &value, G_TYPE_INVALID);
+	if (!ret) {
+		g_warning ("IsLocal failed: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* return value only if we successed */
+	ret = value;
+out:
+	return ret;
+}
+
+/**
+ * egg_console_kit_is_active:
+ *
+ * Return value: Returns whether the session is active on the Seat that it is attached to.
+ **/
+gboolean
+egg_console_kit_is_active (EggConsoleKit *console)
+{
+	gboolean ret = FALSE;
+	gboolean value = FALSE;
+	GError *error = NULL;
+
+	g_return_val_if_fail (EGG_IS_CONSOLE_KIT (console), FALSE);
+
+	/* maybe console kit does not know about our session */
+	if (console->priv->proxy_session == NULL) {
+		egg_warning ("no ConsoleKit session");
+		goto out;
+	}
+
+	/* is our session active */
+	ret = dbus_g_proxy_call (console->priv->proxy_session, "IsActive", &error, G_TYPE_INVALID,
+				 G_TYPE_BOOLEAN, &value, G_TYPE_INVALID);
+	if (!ret) {
+		g_warning ("IsActive failed: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* return value only if we successed */
+	ret = value;
+out:
+	return ret;
+}
+
+/**
+ * egg_console_kit_active_changed_cb:
+ **/
+static void
+egg_console_kit_active_changed_cb (DBusGProxy *proxy, gboolean active, EggConsoleKit *console)
+{
+	egg_debug ("emitting active: %i", active);
+	g_signal_emit (console, signals [EGG_CONSOLE_KIT_ACTIVE_CHANGED], 0, active);
+}
+
+/**
+ * egg_console_kit_class_init:
+ * @klass: The EggConsoleKitClass
+ **/
+static void
+egg_console_kit_class_init (EggConsoleKitClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	object_class->finalize = egg_console_kit_finalize;
+	g_type_class_add_private (klass, sizeof (EggConsoleKitPrivate));
+	signals [EGG_CONSOLE_KIT_ACTIVE_CHANGED] =
+		g_signal_new ("active-changed",
+			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EggConsoleKitClass, active_changed),
+			      NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN,
+			      G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+}
+
+/**
+ * egg_console_kit_init:
+ **/
+static void
+egg_console_kit_init (EggConsoleKit *console)
+{
+	gboolean ret;
+	GError *error = NULL;
+	guint32 pid;
+
+	console->priv = EGG_CONSOLE_KIT_GET_PRIVATE (console);
+	console->priv->proxy_manager = NULL;
+	console->priv->session_id = NULL;
+
+	/* connect to D-Bus */
+	console->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
+	if (console->priv->connection == NULL) {
+		egg_warning ("Failed to connect to the D-Bus daemon: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* connect to ConsoleKit */
+	console->priv->proxy_manager =
+		dbus_g_proxy_new_for_name (console->priv->connection, CONSOLEKIT_NAME,
+					   CONSOLEKIT_MANAGER_PATH, CONSOLEKIT_MANAGER_INTERFACE);
+	if (console->priv->proxy_manager == NULL) {
+		egg_warning ("cannot connect to ConsoleKit");
+		goto out;
+	}
+
+	/* get the session we are running in */
+	pid = getpid ();
+	ret = dbus_g_proxy_call (console->priv->proxy_manager, "GetSessionForUnixProcess", &error,
+				 G_TYPE_UINT, pid,
+				 G_TYPE_INVALID,
+				 DBUS_TYPE_G_OBJECT_PATH, &console->priv->session_id,
+				 G_TYPE_INVALID);
+	if (!ret) {
+		egg_warning ("Failed to get session for pid %i: %s", pid, error->message);
+		g_error_free (error);
+		goto out;
+	}
+	egg_debug ("ConsoleKit session ID: %s", console->priv->session_id);
+
+	/* connect to session */
+	console->priv->proxy_session =
+		dbus_g_proxy_new_for_name (console->priv->connection, CONSOLEKIT_NAME,
+					   console->priv->session_id, CONSOLEKIT_SESSION_INTERFACE);
+	if (console->priv->proxy_session == NULL) {
+		egg_warning ("cannot connect to: %s", console->priv->session_id);
+		goto out;
+	}
+	dbus_g_proxy_add_signal (console->priv->proxy_session, "ActiveChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID);
+	dbus_g_proxy_connect_signal (console->priv->proxy_session, "ActiveChanged",
+				     G_CALLBACK (egg_console_kit_active_changed_cb), console, NULL);
+
+out:
+	return;
+}
+
+/**
+ * egg_console_kit_finalize:
+ * @object: The object to finalize
+ **/
+static void
+egg_console_kit_finalize (GObject *object)
+{
+	EggConsoleKit *console;
+
+	g_return_if_fail (EGG_IS_CONSOLE_KIT (object));
+
+	console = EGG_CONSOLE_KIT (object);
+
+	g_return_if_fail (console->priv != NULL);
+	if (console->priv->proxy_manager != NULL)
+		g_object_unref (console->priv->proxy_manager);
+	if (console->priv->proxy_session != NULL)
+		g_object_unref (console->priv->proxy_session);
+	g_free (console->priv->session_id);
+
+	G_OBJECT_CLASS (egg_console_kit_parent_class)->finalize (object);
+}
+
+/**
+ * egg_console_kit_new:
+ *
+ * Return value: a new EggConsoleKit object.
+ **/
+EggConsoleKit *
+egg_console_kit_new (void)
+{
+	if (egg_console_kit_object != NULL) {
+		g_object_ref (egg_console_kit_object);
+	} else {
+		egg_console_kit_object = g_object_new (EGG_TYPE_CONSOLE_KIT, NULL);
+		g_object_add_weak_pointer (egg_console_kit_object, &egg_console_kit_object);
+	}
+
+	return EGG_CONSOLE_KIT (egg_console_kit_object);
+}
+
--- /dev/null
+++ b/src/egg-console-kit.h
@@ -0,0 +1,71 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __EGG_CONSOLE_KIT_H
+#define __EGG_CONSOLE_KIT_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define EGG_TYPE_CONSOLE_KIT		(egg_console_kit_get_type ())
+#define EGG_CONSOLE_KIT(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), EGG_TYPE_CONSOLE_KIT, EggConsoleKit))
+#define EGG_CONSOLE_KIT_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), EGG_TYPE_CONSOLE_KIT, EggConsoleKitClass))
+#define EGG_IS_CONSOLE_KIT(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), EGG_TYPE_CONSOLE_KIT))
+#define EGG_IS_CONSOLE_KIT_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), EGG_TYPE_CONSOLE_KIT))
+#define EGG_CONSOLE_KIT_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), EGG_TYPE_CONSOLE_KIT, EggConsoleKitClass))
+#define EGG_CONSOLE_KIT_ERROR		(egg_console_kit_error_quark ())
+#define EGG_CONSOLE_KIT_TYPE_ERROR	(egg_console_kit_error_get_type ())
+
+typedef struct EggConsoleKitPrivate EggConsoleKitPrivate;
+
+typedef struct
+{
+	 GObject		 parent;
+	 EggConsoleKitPrivate	*priv;
+} EggConsoleKit;
+
+typedef struct
+{
+	GObjectClass	parent_class;
+	void		(* active_changed)		(EggConsoleKit	*console,
+							 gboolean	 active);
+} EggConsoleKitClass;
+
+GType		 egg_console_kit_get_type	  	(void);
+EggConsoleKit	*egg_console_kit_new			(void);
+gboolean	 egg_console_kit_is_local		(EggConsoleKit	*console);
+gboolean	 egg_console_kit_is_active		(EggConsoleKit	*console);
+gboolean	 egg_console_kit_stop			(EggConsoleKit	*console,
+							 GError		**error);
+gboolean	 egg_console_kit_restart		(EggConsoleKit	*console,
+							 GError		**error);
+gboolean	 egg_console_kit_can_stop		(EggConsoleKit	*console,
+							 gboolean	*can_stop,
+							 GError		**error);
+gboolean	 egg_console_kit_can_restart		(EggConsoleKit	*console,
+							 gboolean	*can_restart,
+							 GError		**error);
+
+G_END_DECLS
+
+#endif /* __EGG_CONSOLE_KIT_H */
+
--- a/src/gpm-backlight.c
+++ b/src/gpm-backlight.c
@@ -50,6 +50,7 @@
 #include "gpm-control.h"
 #include "gpm-common.h"
 #include "egg-debug.h"
+#include "egg-console-kit.h"
 #include "gpm-feedback-widget.h"
 #include "gpm-dpms.h"
 #include "gpm-idle.h"
@@ -72,6 +73,7 @@
 	GpmControl		*control;
 	GpmDpms			*dpms;
 	GpmIdle			*idle;
+	EggConsoleKit		*consolekit;
 	GpmLightSensor		*light_sensor;
 	gboolean		 can_dim;
 	gboolean		 can_sense;
@@ -517,6 +519,12 @@
 		       gboolean		 on_ac,
 		       GpmBacklight     *backlight)
 {
+	/* don't dim or undim the screen unless we are on the active console */
+	if (!egg_console_kit_is_active (backlight->priv->consolekit)) {
+		g_debug ("ignoring as not on active console");
+		return;
+	}
+
 	gpm_backlight_brightness_evaluate_and_set (backlight, TRUE);
 }
 
@@ -652,6 +660,12 @@
 		return;
 	}
 
+	/* don't dim or undim the screen unless we are on the active console */
+	if (!egg_console_kit_is_active (backlight->priv->consolekit)) {
+		g_debug ("ignoring as not on active console");
+		return;
+	}
+
 	if (mode == GPM_IDLE_MODE_NORMAL) {
 		/* deactivate display power management */
 		if (backlight->priv->can_dpms) {
@@ -808,6 +822,7 @@
 	if (backlight->priv->brightness != NULL) {
 		g_object_unref (backlight->priv->brightness);
 	}
+	g_object_unref (backlight->priv->consolekit);
 
 	g_return_if_fail (backlight->priv != NULL);
 	G_OBJECT_CLASS (gpm_backlight_parent_class)->finalize (object);
@@ -955,6 +970,9 @@
 	g_signal_connect (backlight->priv->idle, "idle-changed",
 			  G_CALLBACK (idle_changed_cb), backlight);
 
+	/* Don't do dimming on inactive console */
+	backlight->priv->consolekit = egg_console_kit_new ();
+
 	/* sync at startup */
 	gpm_light_sensor_get_absolute (backlight->priv->light_sensor, &value);
 	backlight->priv->ambient_sensor_value = value / 100.0f;
--- a/src/gpm-control.c
+++ b/src/gpm-control.c
@@ -53,6 +53,7 @@
 #include "gpm-screensaver.h"
 #include "gpm-common.h"
 #include "egg-debug.h"
+#include "egg-console-kit.h"
 #include "gpm-control.h"
 #include "gpm-networkmanager.h"
 
@@ -300,6 +301,7 @@
 	gboolean allowed;
 	gboolean ret;
 	gboolean save_session;
+	EggConsoleKit *console;
 
 	gpm_control_allowed_shutdown (control, &allowed, error);
 	if (allowed == FALSE) {
@@ -320,6 +322,10 @@
 					   FALSE, GNOME_INTERACT_NONE, FALSE,  TRUE);
 	}
 
+	console = egg_console_kit_new ();
+	ret = egg_console_kit_stop (console, error);
+	g_object_unref (console);
+
 	ret = hal_gpower_shutdown (control->priv->hal_power, error);
 	if (!ret) {
 		gpm_control_convert_hal_error (control, error);
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -49,6 +49,7 @@
 #include "gpm-control.h"
 #include "gpm-common.h"
 #include "egg-debug.h"
+#include "egg-console-kit.h"
 #include "gpm-dpms.h"
 #include "gpm-idle.h"
 #include "gpm-info.h"
@@ -103,6 +104,7 @@
 
 	/* interactive services */
 	GpmBacklight		*backlight;
+	EggConsoleKit		*console;
 	GpmSrvBrightnessKbd	*srv_brightness_kbd;
 	GpmSrvScreensaver 	*srv_screensaver;
 };
@@ -885,6 +887,12 @@
 		 GpmIdleMode mode,
 		 GpmManager *manager)
 {
+	/* ConsoleKit says we are not on active console */
+	if (!egg_console_kit_is_active (manager->priv->console)) {
+		egg_debug ("ignoring as not on active console");
+		return;
+	}
+
 	/* Ignore timeout events when the lid is closed, as the DPMS is
 	 * already off, and we don't want to perform policy actions or re-enable
 	 * the screen when the user moves the mouse on systems that do not
@@ -1052,6 +1060,12 @@
 {
 	egg_debug ("Button press event type=%s", type);
 
+	/* ConsoleKit says we are not on active console */
+	if (!egg_console_kit_is_active (manager->priv->console)) {
+		egg_debug ("ignoring as not on active console");
+		return;
+	}
+
 	if (strcmp (type, GPM_BUTTON_POWER) == 0) {
 		power_button_pressed (manager);
 
@@ -1091,6 +1105,12 @@
 	gboolean event_when_closed;
 	gboolean power_save;
 
+	/* ConsoleKit says we are not on active console */
+	if (!egg_console_kit_is_active (manager->priv->console)) {
+		egg_debug ("ignoring as not on active console");
+		return;
+	}
+
 	egg_debug ("Setting on-ac: %d", on_ac);
 
 	gpm_manager_sync_policy_sleep (manager);
@@ -1736,6 +1756,16 @@
 }
 
 /**
+ * gpm_manager_console_kit_active_changed_cb:
+ **/
+static void
+gpm_manager_console_kit_active_changed_cb (EggConsoleKit *console, gboolean active, GpmManager *manager)
+{
+	egg_debug ("console now %s", active ? "active" : "inactive");
+	/* FIXME: do we need to do policy actions when we switch? */
+}
+
+/**
  * gpm_manager_init:
  * @manager: This class instance
  **/
@@ -1756,6 +1786,11 @@
 	/* do some actions even when killed */
 	g_atexit (gpm_manager_at_exit);
 
+	/* don't apply policy when not active */
+	manager->priv->console = egg_console_kit_new ();
+	g_signal_connect (manager->priv->console, "active-changed",
+			  G_CALLBACK (gpm_manager_console_kit_active_changed_cb), manager);
+
 	/* this is a singleton, so we keep a master copy open here */
 	manager->priv->prefs_server = gpm_prefs_server_new ();
 
@@ -1924,6 +1959,7 @@
 	g_object_unref (manager->priv->srv_screensaver);
 	g_object_unref (manager->priv->prefs_server);
 	g_object_unref (manager->priv->control);
+	g_object_unref (manager->priv->console);
 
 	/* optional gobjects */
 	if (manager->priv->button) {
