gs_manager_deactivate (GSManager *manager)
{
        g_return_val_if_fail (manager != NULL, FALSE);
        g_return_val_if_fail (GS_IS_MANAGER (manager), FALSE);

        if (! manager->priv->active) {
                gs_debug ("Trying to deactivate a screensaver that is not active");
                return FALSE;
        }

        remove_unfade_idle (manager);
        gs_fade_reset (manager->priv->fade);
        remove_timers (manager);

        gs_grab_release (manager->priv->grab);

        manager_stop_jobs (manager);

        gs_manager_destroy_windows (manager);

        /* reset state */
        manager->priv->active = FALSE;
        manager->priv->activate_time = 0;
        manager->priv->lock_active = FALSE;
        manager->priv->dialog_up = FALSE;
        manager->priv->fading = FALSE;

        return TRUE;
}
gs_manager_deactivate (GSManager *manager)
{
        g_return_val_if_fail (manager != NULL, FALSE);
        g_return_val_if_fail (GS_IS_MANAGER (manager), FALSE);

        if (! manager->priv->active) {
                gs_debug ("Trying to deactivate a screensaver that is not active");
                return FALSE;
        }

        remove_unfade_idle (manager);
        gs_fade_reset (manager->priv->fade);
        remove_timers (manager);

        gs_grab_release (manager->priv->grab);

        manager_stop_jobs (manager);

        gs_manager_destroy_windows (manager);

         
        manager->priv->active = FALSE;
        manager->priv->activate_time = 0;
        manager->priv->lock_active = FALSE;
        manager->priv->dialog_up = FALSE;
        manager->priv->fading = FALSE;

        return TRUE;
}