From 52b2a291e980e75e3fc45aa3d0ae2f8f40566c2a Mon Sep 17 00:00:00 2001 From: "Marco Trevisan (Treviño)" Date: Thu, 27 Jan 2011 00:29:57 +0100 Subject: app-indicator: listen for XAyatanaScrollAction and emit "scroll-event" signal libappindicator now when it gets a dbus call from indicator-application (via the method XAyatanaScrollAction) about the incoming scroll event, sends a "scroll-event" signal to the appindicator application using this library. This works both in indicator and fallback (systray mode). This commit includes a fix for bug #707591 --- src/notification-item.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/notification-item.xml') diff --git a/src/notification-item.xml b/src/notification-item.xml index 05afd83..48e9695 100644 --- a/src/notification-item.xml +++ b/src/notification-item.xml @@ -17,7 +17,10 @@ - + + + + @@ -34,6 +37,5 @@ - -- cgit v1.2.3 From 0d97a5e6201be283ba2dd017297b71122c7f19e2 Mon Sep 17 00:00:00 2001 From: "Marco Trevisan (Treviño)" Date: Sat, 29 Jan 2011 03:27:29 +0100 Subject: Using the SNI method "Scroll" instead of XAyatanaScrollAction The indicator signal will use anyway the same syntax. --- src/app-indicator.c | 19 ++++++++++++++++--- src/notification-item.xml | 4 ++-- 2 files changed, 18 insertions(+), 5 deletions(-) (limited to 'src/notification-item.xml') diff --git a/src/app-indicator.c b/src/app-indicator.c index 4bef6de..26d8c73 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -929,12 +929,25 @@ bus_method_call (GDBusConnection * connection, const gchar * sender, AppIndicator * app = APP_INDICATOR(user_data); GVariant * retval = NULL; - if (g_strcmp0(method, "XAyatanaScrollAction") == 0) { - gint delta; + if (g_strcmp0(method, "Scroll") == 0) { guint direction; + gint delta; + const gchar *orientation; + + g_variant_get(params, "(i&s)", &delta, &orientation); + + if (g_strcmp0(orientation, "horizontal") == 0) { + direction = (delta >= 0) ? GDK_SCROLL_RIGHT : GDK_SCROLL_LEFT; + } else if (g_strcmp0(orientation, "vertical") == 0) { + direction = (delta >= 0) ? GDK_SCROLL_DOWN : GDK_SCROLL_UP; + } else { + g_dbus_method_invocation_return_value(invocation, retval); + return; + } - g_variant_get(params, "(iu)", &delta, &direction); + delta = ABS(delta); g_signal_emit(app, signals[SCROLL_EVENT], 0, delta, direction); + } else { g_warning("Calling method '%s' on the app-indicator and it's unknown", method); } diff --git a/src/notification-item.xml b/src/notification-item.xml index 48e9695..127eb3a 100644 --- a/src/notification-item.xml +++ b/src/notification-item.xml @@ -17,9 +17,9 @@ - + - + -- cgit v1.2.3