diff options
author | Ted Gould <ted@gould.cx> | 2010-01-12 16:04:58 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-01-12 16:04:58 -0600 |
commit | 348bcfba144c1e2f3025352f23f038829558bc7f (patch) | |
tree | 7f47fc9314a9ec024ab60263c3b5e686dae9fd73 | |
parent | 4a1b7228d3fd9cfa163082c2bbf5b2982c6b525b (diff) | |
download | libayatana-appindicator-348bcfba144c1e2f3025352f23f038829558bc7f.tar.gz libayatana-appindicator-348bcfba144c1e2f3025352f23f038829558bc7f.tar.bz2 libayatana-appindicator-348bcfba144c1e2f3025352f23f038829558bc7f.zip |
Woah, this is pretty sweet. I hope it works.
-rw-r--r-- | tests/test-libappindicator-fallback-watcher.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test-libappindicator-fallback-watcher.c b/tests/test-libappindicator-fallback-watcher.c index 67109e5..07d8da6 100644 --- a/tests/test-libappindicator-fallback-watcher.c +++ b/tests/test-libappindicator-fallback-watcher.c @@ -23,11 +23,25 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <glib.h> #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-bindings.h> +#include <dbus/dbus-glib-lowlevel.h> #include "../src/dbus-shared.h" static GMainLoop * mainloop = NULL; +static DBusHandlerResult +dbus_filter (DBusConnection * connection, DBusMessage * message, void * user_data) +{ + if (dbus_message_is_method_call(message, NOTIFICATION_WATCHER_DBUS_ADDR, "RegisterStatusNotifierItem")) { + DBusMessage * reply = dbus_message_new_method_return(message); + dbus_connection_send(connection, reply, NULL); + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; + } + + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +} + gboolean kill_func (gpointer userdata) { @@ -63,6 +77,8 @@ main (int argv, char ** argc) return 1; } + dbus_connection_add_filter(dbus_g_connection_get_connection(session_bus), dbus_filter, NULL, NULL); + /* After we've got the name, let it unfallback, and then we'll drop again */ g_timeout_add(250, kill_func, NULL); |