static gboolean on_signal_term (gpointer user_data) { gkd_main_quit (); g_debug ("received signal, terminating"); return FALSE; }
static DBusHandlerResult signal_filter (DBusConnection *conn, DBusMessage *msg, void *user_data) { /* Quit the daemon when the session is over */ if (dbus_message_is_signal (msg, IFACE_SESSION_PRIVATE, "Stop")) { unregister_daemon_in_session (conn); gkd_main_quit (); return DBUS_HANDLER_RESULT_HANDLED; } else if (dbus_message_is_signal (msg, IFACE_SESSION_PRIVATE, "QueryEndSession")) { send_end_session_response (conn); return DBUS_HANDLER_RESULT_HANDLED; } else if (dbus_message_is_signal (msg, IFACE_SESSION_PRIVATE, "EndSession")) { send_end_session_response (conn); unregister_daemon_in_session (conn); gkd_main_quit (); return DBUS_HANDLER_RESULT_HANDLED; } else if (dbus_message_is_signal (msg, DBUS_INTERFACE_LOCAL, "Disconnected")) { unregister_daemon_in_session (conn); gkd_main_quit (); return DBUS_HANDLER_RESULT_HANDLED; } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; }
static void on_connection_close (gpointer user_data) { g_debug ("dbus connection closed, exiting"); gkd_main_quit (); }