aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-application.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-08-11 11:54:27 -0500
committerTed Gould <ted@gould.cx>2011-08-11 11:54:27 -0500
commite7d1dd3c138ddfab3a23d384a4c4c5f89cb408db (patch)
tree3bfb6a2071a7c3ac7277be335d852ef472121bc6 /src/indicator-application.c
parent457dd74bc8752065e9558f5a67a50635a06b8ffc (diff)
parent3bb503c831ba18d97a05419dc44781076712ea74 (diff)
downloadayatana-indicator-application-e7d1dd3c138ddfab3a23d384a4c4c5f89cb408db.tar.gz
ayatana-indicator-application-e7d1dd3c138ddfab3a23d384a4c4c5f89cb408db.tar.bz2
ayatana-indicator-application-e7d1dd3c138ddfab3a23d384a4c4c5f89cb408db.zip
Import upstream version 0.3.92
Diffstat (limited to 'src/indicator-application.c')
-rw-r--r--src/indicator-application.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c
index dc810f4..24ec7d4 100644
--- a/src/indicator-application.c
+++ b/src/indicator-application.c
@@ -110,6 +110,7 @@ static void indicator_application_finalize (GObject *object);
static GList * get_entries (IndicatorObject * io);
static guint get_location (IndicatorObject * io, IndicatorObjectEntry * entry);
static void entry_scrolled (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction);
+static void entry_secondary_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint time, gpointer data);
void connection_changed (IndicatorServiceManager * sm, gboolean connected, IndicatorApplication * application);
static void connected (IndicatorApplication * application);
static void disconnected (IndicatorApplication * application);
@@ -144,6 +145,7 @@ indicator_application_class_init (IndicatorApplicationClass *klass)
io_class->get_entries = get_entries;
io_class->get_location = get_location;
+ io_class->secondary_activate = entry_secondary_activate;
io_class->entry_scrolled = entry_scrolled;
return;
@@ -402,9 +404,34 @@ get_location (IndicatorObject * io, IndicatorObjectEntry * entry)
return g_list_index(priv->applications, entry);
}
+/* Redirect the secondary activate to the Application Item */
+static void
+entry_secondary_activate (IndicatorObject * io, IndicatorObjectEntry * entry,
+ guint time, gpointer data)
+{
+ g_return_if_fail(IS_INDICATOR_APPLICATION(io));
+
+ IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(io);
+ g_return_if_fail(priv->service_proxy);
+
+ GList *l = g_list_find(priv->applications, entry);
+ if (l == NULL)
+ return;
+
+ ApplicationEntry *app = l->data;
+
+ if (app && app->dbusaddress && app->dbusobject && priv->service_proxy) {
+ g_dbus_proxy_call(priv->service_proxy, "ApplicationSecondaryActivateEvent",
+ g_variant_new("(ssu)", app->dbusaddress,
+ app->dbusobject,
+ time),
+ G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL);
+ }
+}
+
/* Redirect the scroll event to the Application Item */
-static void entry_scrolled (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction) {
-
+static void entry_scrolled (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction)
+{
g_return_if_fail(IS_INDICATOR_APPLICATION(io));
IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(io);
@@ -418,9 +445,9 @@ static void entry_scrolled (IndicatorObject * io, IndicatorObjectEntry * entry,
if (app && app->dbusaddress && app->dbusobject && priv->service_proxy) {
g_dbus_proxy_call(priv->service_proxy, "ApplicationScrollEvent",
- g_variant_new("(ssiu)", app->dbusaddress,
- app->dbusobject,
- delta, direction),
+ g_variant_new("(ssiu)", app->dbusaddress,
+ app->dbusobject,
+ delta, direction),
G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL);
}
}
@@ -861,7 +888,7 @@ get_applications (GObject * obj, GAsyncResult * res, gpointer user_data)
}
/* Get our new applications that we got in the request */
- g_variant_get(result, "(a(sisossss))", &iter);
+ g_variant_get(result, "(a(sisosssss))", &iter);
while ((child = g_variant_iter_next_value (iter))) {
get_applications_helper(self, child);
g_variant_unref(child);