edd0f41c1d
ok jasper@
93 lines
2.5 KiB
Plaintext
93 lines
2.5 KiB
Plaintext
$OpenBSD: patch-gnome-session_gsm-manager_c,v 1.6 2010/09/30 07:37:05 ajacoutot Exp $
|
|
|
|
OpenBSD does not support uPower.
|
|
|
|
--- gnome-session/gsm-manager.c.orig Thu Jul 15 14:53:08 2010
|
|
+++ gnome-session/gsm-manager.c Tue Sep 28 13:53:51 2010
|
|
@@ -38,7 +38,9 @@
|
|
#include <dbus/dbus-glib.h>
|
|
#include <dbus/dbus-glib-lowlevel.h>
|
|
|
|
+#ifndef __OpenBSD__
|
|
#include <upower.h>
|
|
+#endif
|
|
|
|
#include <gtk/gtk.h> /* for logout dialog */
|
|
#include <gconf/gconf-client.h>
|
|
@@ -135,7 +137,9 @@ struct GsmManagerPrivate
|
|
DBusGConnection *connection;
|
|
|
|
/* Interface with other parts of the system */
|
|
+#ifndef __OpenBSD__
|
|
UpClient *up_client;
|
|
+#endif
|
|
};
|
|
|
|
enum {
|
|
@@ -983,6 +987,7 @@ manager_perhaps_lock (GsmManager *manager)
|
|
static void
|
|
manager_attempt_hibernate (GsmManager *manager)
|
|
{
|
|
+#ifndef __OpenBSD__
|
|
gboolean can_hibernate;
|
|
GError *error;
|
|
gboolean ret;
|
|
@@ -1001,11 +1006,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;
|
|
@@ -1024,6 +1031,7 @@ manager_attempt_suspend (GsmManager *manager)
|
|
g_error_free (error);
|
|
}
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
static void
|
|
@@ -2196,10 +2204,12 @@ gsm_manager_dispose (GObject *object)
|
|
manager->priv->gconf_client = NULL;
|
|
}
|
|
|
|
+#ifndef __OpenBSD__
|
|
if (manager->priv->up_client != NULL) {
|
|
g_object_unref (manager->priv->up_client);
|
|
manager->priv->up_client = NULL;
|
|
}
|
|
+#endif
|
|
|
|
G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
|
|
}
|
|
@@ -2429,7 +2439,9 @@ gsm_manager_init (GsmManager *manager)
|
|
G_CALLBACK (on_presence_status_changed),
|
|
manager);
|
|
|
|
+#ifndef __OpenBSD__
|
|
manager->priv->up_client = up_client_new ();
|
|
+#endif
|
|
|
|
/* GConf setup */
|
|
gconf_client_add_dir (manager->priv->gconf_client,
|
|
@@ -2953,10 +2965,12 @@ gsm_manager_can_shutdown (GsmManager *manager,
|
|
gboolean can_suspend;
|
|
gboolean can_hibernate;
|
|
|
|
+#ifndef __OpenBSD__
|
|
g_object_get (manager->priv->up_client,
|
|
"can-suspend", &can_suspend,
|
|
"can-hibernate", &can_hibernate,
|
|
NULL);
|
|
+#endif
|
|
|
|
g_debug ("GsmManager: CanShutdown called");
|
|
|