diff options
author | Ali Abdallah <ali.slackware@gmail.com> | 2009-06-27 22:19:57 +0000 |
---|---|---|
committer | Ali Abdallah <ali.slackware@gmail.com> | 2009-06-27 22:19:57 +0000 |
commit | 2da2448c6e4917a20642bc2cc599fb7e4b1a3022 (patch) | |
tree | 87a795b4a20966dab3a1a3a5b2d5052dfd591930 /src/xfpm-inhibit.c | |
parent | 52173d145eaa86f3fe581509d61d93e2b2bfaf7e (diff) | |
download | ixfce4-power-manager-2da2448c6e4917a20642bc2cc599fb7e4b1a3022.tar.gz |
* Use xfpm-dbus-monitor for dbus monitoring stuff, so hal-monitor is removed.
* hal-device.c Fix a Glib warnings when DBus is disconnected.
(Old svn revision: 7631)
Diffstat (limited to 'src/xfpm-inhibit.c')
-rw-r--r-- | src/xfpm-inhibit.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/xfpm-inhibit.c b/src/xfpm-inhibit.c index be152710..c92dc96d 100644 --- a/src/xfpm-inhibit.c +++ b/src/xfpm-inhibit.c @@ -176,7 +176,7 @@ xfpm_inhibit_remove_application_by_cookie (XfpmInhibit *inhibit, guint cookie) if ( inhibitor ) { - xfpm_dbus_monitor_remove_match (inhibit->priv->monitor, inhibitor->unique_name); + xfpm_dbus_monitor_remove_unique_name (inhibit->priv->monitor, DBUS_BUS_SESSION, inhibitor->unique_name); xfpm_inhibit_free_inhibitor (inhibit, inhibitor); return TRUE; } @@ -184,10 +184,14 @@ xfpm_inhibit_remove_application_by_cookie (XfpmInhibit *inhibit, guint cookie) } static void -xfpm_inhibit_connection_lost_cb (XfpmDBusMonitor *monitor, gchar *unique_name, XfpmInhibit *inhibit) +xfpm_inhibit_connection_lost_cb (XfpmDBusMonitor *monitor, gchar *unique_name, + gboolean on_session, XfpmInhibit *inhibit) { Inhibitor *inhibitor; + if ( !on_session) + return; + inhibitor = xfpm_inhibit_find_application_by_unique_connection_name (inhibit, unique_name ); if ( inhibitor ) @@ -204,7 +208,7 @@ xfpm_inhibit_class_init(XfpmInhibitClass *klass) GObjectClass *object_class = G_OBJECT_CLASS(klass); signals[HAS_INHIBIT_CHANGED] = - g_signal_new("has-inhibit-changed", + g_signal_new ("has-inhibit-changed", XFPM_TYPE_INHIBIT, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(XfpmInhibitClass, has_inhibit_changed), @@ -214,27 +218,27 @@ xfpm_inhibit_class_init(XfpmInhibitClass *klass) object_class->finalize = xfpm_inhibit_finalize; - g_type_class_add_private(klass,sizeof(XfpmInhibitPrivate)); + g_type_class_add_private (klass, sizeof (XfpmInhibitPrivate)); xfpm_inhibit_dbus_class_init (klass); } static void -xfpm_inhibit_init(XfpmInhibit *inhibit) +xfpm_inhibit_init (XfpmInhibit *inhibit) { inhibit->priv = XFPM_INHIBIT_GET_PRIVATE(inhibit); inhibit->priv->array = g_ptr_array_new (); inhibit->priv->monitor = xfpm_dbus_monitor_new (); - g_signal_connect (inhibit->priv->monitor, "connection-lost", + g_signal_connect (inhibit->priv->monitor, "unique-name-lost", G_CALLBACK (xfpm_inhibit_connection_lost_cb), inhibit); xfpm_inhibit_dbus_init (inhibit); } static void -xfpm_inhibit_finalize(GObject *object) +xfpm_inhibit_finalize (GObject *object) { XfpmInhibit *inhibit; Inhibitor *inhibitor; @@ -338,7 +342,7 @@ static void xfpm_inhibit_inhibit (XfpmInhibit *inhibit, xfpm_inhibit_has_inhibit_changed (inhibit); - xfpm_dbus_monitor_add_match (inhibit->priv->monitor, sender); + xfpm_dbus_monitor_add_unique_name (inhibit->priv->monitor, DBUS_BUS_SESSION, sender); g_free (sender); dbus_g_method_return (context, cookie); |