111 lines
3.2 KiB
Plaintext
111 lines
3.2 KiB
Plaintext
$OpenBSD: patch-gnome-session_gsm-manager_c,v 1.3 2010/04/22 22:38:51 ajacoutot Exp $
|
|
|
|
OpenBSD does not have DeviceKit.
|
|
|
|
GNOME Bugzilla #598211
|
|
Do not keep zombie clients.
|
|
|
|
--- gnome-session/gsm-manager.c.orig Fri Apr 23 00:33:12 2010
|
|
+++ gnome-session/gsm-manager.c Fri Apr 23 00:33:12 2010
|
|
@@ -38,7 +38,9 @@
|
|
#include <dbus/dbus-glib.h>
|
|
#include <dbus/dbus-glib-lowlevel.h>
|
|
|
|
+#ifndef __OpenBSD__
|
|
#include <devkit-power-gobject/devicekit-power.h>
|
|
+#endif
|
|
|
|
#include <gtk/gtk.h> /* for logout dialog */
|
|
#include <gconf/gconf-client.h>
|
|
@@ -135,8 +137,10 @@ struct GsmManagerPrivate
|
|
DBusGProxy *bus_proxy;
|
|
DBusGConnection *connection;
|
|
|
|
+#ifndef __OpenBSD__
|
|
/* Interface with other parts of the system */
|
|
DkpClient *dkp_client;
|
|
+#endif
|
|
};
|
|
|
|
enum {
|
|
@@ -984,6 +988,7 @@ manager_perhaps_lock (GsmManager *manager)
|
|
static void
|
|
manager_attempt_hibernate (GsmManager *manager)
|
|
{
|
|
+#ifndef __OpenBSD__
|
|
gboolean can_hibernate;
|
|
GError *error;
|
|
gboolean ret;
|
|
@@ -1005,11 +1010,13 @@ manager_attempt_hibernate (GsmManager *manager)
|
|
g_error_free (error);
|
|
}
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
static void
|
|
manager_attempt_suspend (GsmManager *manager)
|
|
{
|
|
+#ifndef __OpenBSD__
|
|
gboolean can_suspend;
|
|
GError *error;
|
|
gboolean ret;
|
|
@@ -1031,6 +1038,7 @@ manager_attempt_suspend (GsmManager *manager)
|
|
g_error_free (error);
|
|
}
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
static void
|
|
@@ -2111,9 +2119,11 @@ on_store_client_added (GsmStore *store,
|
|
"end-session-response",
|
|
G_CALLBACK (on_client_end_session_response),
|
|
manager);
|
|
-
|
|
+ g_signal_connect (client,
|
|
+ "disconnected",
|
|
+ G_CALLBACK (on_client_disconnected),
|
|
+ manager);
|
|
g_signal_emit (manager, signals [CLIENT_ADDED], 0, id);
|
|
- /* FIXME: disconnect signal handler */
|
|
}
|
|
|
|
static void
|
|
@@ -2313,10 +2323,12 @@ gsm_manager_dispose (GObject *object)
|
|
manager->priv->gconf_client = NULL;
|
|
}
|
|
|
|
+#ifndef __OpenBSD__
|
|
if (manager->priv->dkp_client != NULL) {
|
|
g_object_unref (manager->priv->dkp_client);
|
|
manager->priv->dkp_client = NULL;
|
|
}
|
|
+#endif
|
|
|
|
G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
|
|
}
|
|
@@ -2546,7 +2558,9 @@ gsm_manager_init (GsmManager *manager)
|
|
G_CALLBACK (on_presence_status_changed),
|
|
manager);
|
|
|
|
+#ifndef __OpenBSD__
|
|
manager->priv->dkp_client = dkp_client_new ();
|
|
+#endif
|
|
|
|
/* GConf setup */
|
|
gconf_client_add_dir (manager->priv->gconf_client,
|
|
@@ -3105,10 +3119,12 @@ gsm_manager_can_shutdown (GsmManager *manager,
|
|
gboolean can_suspend;
|
|
gboolean can_hibernate;
|
|
|
|
+#ifndef __OpenBSD__
|
|
g_object_get (manager->priv->dkp_client,
|
|
"can-suspend", &can_suspend,
|
|
"can-hibernate", &can_hibernate,
|
|
NULL);
|
|
+#endif
|
|
|
|
g_debug ("GsmManager: CanShutdown called");
|
|
|