aboutsummaryrefslogtreecommitdiff
path: root/src/app-indicator.c
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2011-01-29 03:27:29 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2011-01-29 03:27:29 +0100
commit0d97a5e6201be283ba2dd017297b71122c7f19e2 (patch)
treea8c971e3d682e4ea3eaaf0457b57a06fdd158b7a /src/app-indicator.c
parenta71428d1eb3598bc2739249ddd96b6a5ef1115f0 (diff)
downloadlibayatana-appindicator-0d97a5e6201be283ba2dd017297b71122c7f19e2.tar.gz
libayatana-appindicator-0d97a5e6201be283ba2dd017297b71122c7f19e2.tar.bz2
libayatana-appindicator-0d97a5e6201be283ba2dd017297b71122c7f19e2.zip
Using the SNI method "Scroll" instead of XAyatanaScrollAction
The indicator signal will use anyway the same syntax.
Diffstat (limited to 'src/app-indicator.c')
-rw-r--r--src/app-indicator.c19
1 files changed, 16 insertions, 3 deletions
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);
}