gnome-session r4699 - in trunk: . gnome-session
- From: lucasr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-session r4699 - in trunk: . gnome-session
- Date: Sat, 24 May 2008 20:31:35 +0000 (UTC)
Author: lucasr
Date: Sat May 24 20:31:35 2008
New Revision: 4699
URL: http://svn.gnome.org/viewvc/gnome-session?rev=4699&view=rev
Log:
2008-05-24 Lucas Rocha <lucasr gnome org>
Emit "SessionOver" D-Bus signal before ending the session.
* gnome-session/dbus.[ch]
(gsm_dbus_server_class_init): add "session-over" signal to
GsmDBusServer class.
(gsm_dbus_session_over): new method for emitting the new signal.
* gnome-session/org.gnome.SessionManagement.xml: added "SessionOver"
signal.
* gnome-session/session.c (session_shutdown): added
gsm_dbus_session_over() call.
Modified:
trunk/ChangeLog
trunk/gnome-session/dbus.c
trunk/gnome-session/dbus.h
trunk/gnome-session/org.gnome.SessionManagement.xml
trunk/gnome-session/session.c
Modified: trunk/gnome-session/dbus.c
==============================================================================
--- trunk/gnome-session/dbus.c (original)
+++ trunk/gnome-session/dbus.c Sat May 24 20:31:35 2008
@@ -36,6 +36,13 @@
#include "gsm.h"
#include "dbus.h"
+enum {
+ SESSION_OVER,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
static DBusGConnection *connection = NULL;
/**
@@ -131,7 +138,6 @@
typedef struct
{
GObjectClass parent_class;
-
} GsmDBusServerClass;
static GType gsm_dbus_server_get_type (void) G_GNUC_CONST;
@@ -170,6 +176,18 @@
static void
gsm_dbus_server_class_init (GsmDBusServerClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ signals[SESSION_OVER] =
+ g_signal_new ("session-over",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+
dbus_g_object_type_install_info (GSM_TYPE_DBUS_SERVER,
&dbus_glib_gsm_dbus_server_object_info);
}
@@ -328,6 +346,12 @@
}
void
+gsm_dbus_session_over ()
+{
+ g_signal_emit (global_dbus_server, signals[SESSION_OVER], 0);
+}
+
+void
gsm_dbus_shutdown (void)
{
g_object_unref (global_dbus_server);
Modified: trunk/gnome-session/dbus.h
==============================================================================
--- trunk/gnome-session/dbus.h (original)
+++ trunk/gnome-session/dbus.h Sat May 24 20:31:35 2008
@@ -22,10 +22,11 @@
#ifndef __GSM_DBUS_H__
#define __GSM_DBUS_H__
-void gsm_dbus_init (void);
-void gsm_dbus_check (void);
-void gsm_dbus_run (void);
-void gsm_dbus_shutdown (void);
+void gsm_dbus_init (void);
+void gsm_dbus_check (void);
+void gsm_dbus_session_over (void);
+void gsm_dbus_run (void);
+void gsm_dbus_shutdown (void);
DBusGConnection *gsm_dbus_get_connection (void);
Modified: trunk/gnome-session/org.gnome.SessionManagement.xml
==============================================================================
--- trunk/gnome-session/org.gnome.SessionManagement.xml (original)
+++ trunk/gnome-session/org.gnome.SessionManagement.xml Sat May 24 20:31:35 2008
@@ -2,7 +2,6 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.gnome.SessionManager">
-
<!-- Initialization phase interfaces -->
<method name="Setenv">
@@ -28,5 +27,8 @@
<arg name="name" type="s" direction="in"/>
</method>
+ <signal name="SessionOver">
+ </signal>
+
</interface>
</node>
Modified: trunk/gnome-session/session.c
==============================================================================
--- trunk/gnome-session/session.c (original)
+++ trunk/gnome-session/session.c Sat May 24 20:31:35 2008
@@ -31,6 +31,7 @@
#include "gsm.h"
#include "session.h"
#include "xsmp.h"
+#include "dbus.h"
#include "util.h"
static void append_default_apps (GsmSession *session,
@@ -871,6 +872,9 @@
{
GSList *cl;
+ /* Emit session over signal */
+ gsm_dbus_session_over ();
+
/* FIXME: do this in reverse phase order */
for (cl = session->clients; cl; cl = cl->next)
gsm_client_die (cl->data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]