--- gnome-screensaver-2.30.0/src/gs-listener-dbus.c~	2010-02-01 23:11:41.000000000 -0500
+++ gnome-screensaver-2.30.0/src/gs-listener-dbus.c	2010-07-05 18:29:54.223154138 -0400
@@ -302,6 +302,7 @@
         return is_set;
 }
 
+/* Return true if the activation is successful */
 static gboolean
 listener_check_activation (GSListener *listener)
 {
@@ -311,11 +312,13 @@
         gs_debug ("Checking for activation");
 
         if (! listener->priv->activation_enabled) {
-                return TRUE;
+                gs_debug ("FALSE: Activation not enabled!");
+                return FALSE;
         }
 
         if (! listener->priv->session_idle) {
-                return TRUE;
+                gs_debug ("FALSE: Session not idle!");
+                return FALSE;
         }
 
         /* if we aren't inhibited then activate */
@@ -325,8 +328,12 @@
         if (! inhibited) {
                 gs_debug ("Trying to activate");
                 res = gs_listener_set_active (listener, TRUE);
+        } else {
+                gs_debug ("FALSE: Activation inhibited!");
         }
 
+        gs_debug ("Activation success: %s", res ? "TRUE" : "FALSE");
+
         return res;
 }
 
@@ -435,38 +442,54 @@
 gs_listener_set_session_idle (GSListener *listener,
                               gboolean    idle)
 {
+        gboolean inhibited;
         gboolean res;
 
         g_return_val_if_fail (GS_IS_LISTENER (listener), FALSE);
 
         gs_debug ("Setting session idle: %d", idle);
 
+        /* if this message is redundant, don't handle the signal
+         * (i.e., return false)
+         */
         if (listener->priv->session_idle == idle) {
-                gs_debug ("Trying to set idle state when already %s",
+                gs_debug ("Trying to set %s state when already %s",
+                          idle ? "idle" : "not idle",
                           idle ? "idle" : "not idle");
                 return FALSE;
         }
 
-        if (idle) {
-                gboolean inhibited;
+        if (! idle) {
+                /* we successfully change the idle setting to false,
+                 * and handle the signal (i.e., return true)
+                 */
+                gs_debug ("Changing session idle state to: FALSE");
+                listener->priv->session_idle = FALSE;
+                listener_set_session_idle_internal (listener, FALSE);
+                return TRUE;
+        }
 
-                inhibited = listener_ref_entry_is_present (listener, REF_ENTRY_TYPE_INHIBIT);
+        inhibited = listener_ref_entry_is_present (listener, REF_ENTRY_TYPE_INHIBIT);
 
-                /* if we are inhibited then do nothing */
-                if (inhibited) {
-                        return FALSE;
-                }
+        /* if we are inhibited then do not set idle and don't handle
+         * the signal (i.e., return false)
+         */
+        if (inhibited) {
+                gs_debug ("Tried to change session idle state to TRUE, but failed due to inhibition");
+                return FALSE;
         }
 
-        listener->priv->session_idle = idle;
+        listener->priv->session_idle = TRUE;
         res = listener_check_activation (listener);
 
-        /* if activation fails then don't set idle */
+        /* if activation succeeds, set idle internally, otherwise don't
+         * set idle at all
+         */
         if (res) {
-                listener_set_session_idle_internal (listener, idle);
+                listener_set_session_idle_internal (listener, TRUE);
         } else {
                 gs_debug ("Idle activation failed");
-                listener->priv->session_idle = !idle;
+                listener->priv->session_idle = FALSE;
         }
 
         return res;
