diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2011-01-27 00:23:32 +0100 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2011-01-27 00:23:32 +0100 |
commit | 6adb897aad99b5ad100bcc1a1e7c12a8d3580ecb (patch) | |
tree | 3132189d1deb6c2f352c6cd994bad9b5ebc9d2b9 /src | |
parent | e6f4e517660c981eb453d0125460a1704c07461e (diff) | |
download | ayatana-indicator-application-6adb897aad99b5ad100bcc1a1e7c12a8d3580ecb.tar.gz ayatana-indicator-application-6adb897aad99b5ad100bcc1a1e7c12a8d3580ecb.tar.bz2 ayatana-indicator-application-6adb897aad99b5ad100bcc1a1e7c12a8d3580ecb.zip |
application-appstore: support for ApplicationScrollSignal method
When the ApplicationScrollSignal is called from indicator-application
the XAyatanaScrollAction method provided by libappindicator is
called with the scroll event data.
So: indicator-application now is listening for that signal
("scroll-entry"), registering a call-back function. When it gets
called, it finds the scrolled application and informs (via dbus)
indicator-application-service that a scroll event has been
registered for that application. Now the service (that is connected
to every indicatorapp running) sends (via dbus, again) to the correct
application the scroll-event informations.
Diffstat (limited to 'src')
-rw-r--r-- | src/application-service-appstore.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 481d886..abe0089 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -260,6 +260,32 @@ bus_method_call (GDBusConnection * connection, const gchar * sender, if (g_strcmp0(method, "GetApplications") == 0) { retval = get_applications(service); + } else if (g_strcmp0(method, "ApplicationScrollSignal") == 0) { + Application *app = NULL; + const gchar *dbusaddress; + const gchar *dbusobject; + gint delta; + guint direction; + + g_variant_get (params, "(&s&siu)", &dbusaddress, &dbusobject, + &delta, &direction); + + GList *l; + for (l = service->priv->applications; l != NULL; l = l->next) { + Application *a = l->data; + + if (g_strcmp0(a->dbus_name, dbusaddress) == 0 && + g_strcmp0(a->menu, dbusobject) == 0) { + app = a; + break; + } + } + + if (app != NULL && app->dbus_proxy != NULL) { + g_dbus_proxy_call(app->dbus_proxy, "XAyatanaScrollAction", + g_variant_new("(iu)", delta, direction), + G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); + } } else { g_warning("Calling method '%s' on the indicator service and it's unknown", method); } |