From 0b4e54d7e08c652fd0468b307f0fe6eeb987a149 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 13 Jan 2009 13:43:32 -0600 Subject: Ah, we weren't checking if we were visible. Now things are better. --- libindicate/server.c | 7 +++++++ libindicate/server.h | 1 + 2 files changed, 8 insertions(+) diff --git a/libindicate/server.c b/libindicate/server.c index f79c78e..8878f69 100644 --- a/libindicate/server.c +++ b/libindicate/server.c @@ -96,6 +96,7 @@ indicate_server_init (IndicateServer * server) server->path = g_strdup("/org/freedesktop/indicate"); server->indicators = NULL; server->num_hidden = 0; + server->visible = FALSE; return; } @@ -126,6 +127,11 @@ indicate_server_error_quark (void) void indicate_server_show (IndicateServer * server) { + g_return_if_fail(INDICATE_IS_SERVER(server)); + + if (server->visible) + return; + DBusGConnection * connection; connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); @@ -133,6 +139,7 @@ indicate_server_show (IndicateServer * server) dbus_g_connection_register_g_object(connection, server->path, G_OBJECT(server)); + server->visible = TRUE; return; } diff --git a/libindicate/server.h b/libindicate/server.h index e119cfd..3844b03 100644 --- a/libindicate/server.h +++ b/libindicate/server.h @@ -24,6 +24,7 @@ struct _IndicateServer { gchar * path; GSList * indicators; + gboolean visible; // TODO: Should have a more robust way to track this, but this'll work for now guint num_hidden; -- cgit v1.2.3