diff options
author | Ted Gould <ted@gould.cx> | 2011-08-11 11:54:27 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-08-11 11:54:27 -0500 |
commit | e7d1dd3c138ddfab3a23d384a4c4c5f89cb408db (patch) | |
tree | 3bfb6a2071a7c3ac7277be335d852ef472121bc6 | |
parent | 457dd74bc8752065e9558f5a67a50635a06b8ffc (diff) | |
parent | 3bb503c831ba18d97a05419dc44781076712ea74 (diff) | |
download | ayatana-indicator-application-e7d1dd3c138ddfab3a23d384a4c4c5f89cb408db.tar.gz ayatana-indicator-application-e7d1dd3c138ddfab3a23d384a4c4c5f89cb408db.tar.bz2 ayatana-indicator-application-e7d1dd3c138ddfab3a23d384a4c4c5f89cb408db.zip |
Import upstream version 0.3.92
-rw-r--r-- | ChangeLog | 66 | ||||
-rwxr-xr-x | configure | 20 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/application-service-appstore.c | 61 | ||||
-rw-r--r-- | src/application-service.xml | 5 | ||||
-rw-r--r-- | src/gen-application-service.xml.c | 5 | ||||
-rw-r--r-- | src/indicator-application.c | 39 |
7 files changed, 164 insertions, 36 deletions
@@ -1,5 +1,71 @@ # Generated by Makefile. Do not edit. +2011-08-11 Ted Gould <ted@gould.cx> + + 0.3.92 + +2011-07-22 Ted Gould <ted@gould.cx> + + Enabling Secondary Activate support + +2011-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net> + + No commit message +2011-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Use g_variant_new_uint32 as we just have one parameter + +2011-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Up + +2011-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Don't use "SecondaryActivate" method + + Using XAyatanaSecondaryActivate as libindicator doesn't support + the mouse x,y position in secondary_activate signal anymore. + + This will drop the middle-click support also for KDE status + notifier items, but this is needed as we can't control + what they would do with this signal (and according to our + policies we can't do anything that isn't doable also using + a menu item). + +2011-07-10 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Add support to the "SecondaryActivate" method + + Added support for the missing StatusNotifierItem SecondaryActivate signal. + The indicator-application receives the "secondary-activate" signal from + libindicator and redirects it via dbus to the proper watcher using the + "SecondaryActivate" method, sending the X and Y pointer position as + parameters (as defined by the StatusNotifierItem specs). + +2011-07-09 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Merge with upstream + +2011-07-22 Ted Gould <ted@gould.cx> + + Fixing the signal prototype + +2011-07-08 Ted Gould <ted@gould.cx> + + Fixing the signature on the startup functions. + +2011-07-08 Ted Gould <ted@gould.cx> + + Forgot an 's' in the case of no app indicators + +2011-07-07 Ted Gould <ted@gould.cx> + + Merging Ken's branch as well. + +2011-06-28 Ken VanDine <ken.vandine@canonical.com> + + Make sure gtk2 builds get pkgconfig info for appindicator-0.1 instead of appindicator3-0.1 + 2011-07-07 Ted Gould <ted@gould.cx> 0.3.91 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for indicator-application 0.3.91. +# Generated by GNU Autoconf 2.68 for indicator-application 0.3.92. # # Report bugs to <ted@canonical.com>. # @@ -572,8 +572,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='indicator-application' PACKAGE_TARNAME='indicator-application' -PACKAGE_VERSION='0.3.91' -PACKAGE_STRING='indicator-application 0.3.91' +PACKAGE_VERSION='0.3.92' +PACKAGE_STRING='indicator-application 0.3.92' PACKAGE_BUGREPORT='ted@canonical.com' PACKAGE_URL='' @@ -1317,7 +1317,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures indicator-application 0.3.91 to adapt to many kinds of systems. +\`configure' configures indicator-application 0.3.92 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1388,7 +1388,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of indicator-application 0.3.91:";; + short | recursive ) echo "Configuration of indicator-application 0.3.92:";; esac cat <<\_ACEOF @@ -1509,7 +1509,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -indicator-application configure 0.3.91 +indicator-application configure 0.3.92 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1789,7 +1789,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by indicator-application $as_me 0.3.91, which was +It was created by indicator-application $as_me 0.3.92, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2610,7 +2610,7 @@ fi # Define the identity of the package. PACKAGE=indicator-application - VERSION=0.3.91 + VERSION=0.3.92 cat >>confdefs.h <<_ACEOF @@ -13365,7 +13365,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by indicator-application $as_me 0.3.91, which was +This file was extended by indicator-application $as_me 0.3.92, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13431,7 +13431,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -indicator-application config.status 0.3.91 +indicator-application config.status 0.3.92 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 112d1f5..3b0bfe3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(indicator-application, 0.3.91, ted@canonical.com) +AC_INIT(indicator-application, 0.3.92, ted@canonical.com) AC_COPYRIGHT([Copyright 2009, 2010 Canonical]) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-application, 0.3.91) +AM_INIT_AUTOMAKE(indicator-application, 0.3.92) AM_MAINTAINER_MODE diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 9cd65b4..d59cfe9 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -142,6 +142,7 @@ static void approver_free (gpointer papprover, gpointer user_data); static void check_with_new_approver (gpointer papp, gpointer papprove); static void check_with_old_approver (gpointer papprove, gpointer papp); static Application * find_application (ApplicationServiceAppstore * appstore, const gchar * address, const gchar * object); +static Application * find_application_by_menu (ApplicationServiceAppstore * appstore, const gchar * address, const gchar * menuobject); static void bus_get_cb (GObject * object, GAsyncResult * res, gpointer user_data); static void dbus_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data); static void app_receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, GVariant * parameters, gpointer user_data); @@ -263,31 +264,20 @@ bus_method_call (GDBusConnection * connection, const gchar * sender, { ApplicationServiceAppstore * service = APPLICATION_SERVICE_APPSTORE(user_data); GVariant * retval = NULL; + Application *app = NULL; + const gchar *dbusaddress; + const gchar *dbusmenuobject; if (g_strcmp0(method, "GetApplications") == 0) { retval = get_applications(service); } else if (g_strcmp0(method, "ApplicationScrollEvent") == 0) { - Application *app = NULL; - const gchar *dbusaddress; - const gchar *dbusobject; gchar *orientation = NULL; gint delta; guint direction; - g_variant_get (params, "(&s&siu)", &dbusaddress, &dbusobject, + g_variant_get (params, "(&s&siu)", &dbusaddress, &dbusmenuobject, &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; - } - } - switch (direction) { case INDICATOR_OBJECT_SCROLL_UP: delta = -delta; @@ -301,9 +291,22 @@ bus_method_call (GDBusConnection * connection, const gchar * sender, orientation = "horizontal"; } + app = find_application_by_menu(service, dbusaddress, dbusmenuobject); + if (app != NULL && app->dbus_proxy != NULL && orientation != NULL) { g_dbus_proxy_call(app->dbus_proxy, "Scroll", - g_variant_new("(is)", delta, orientation), + g_variant_new("(is)", delta, orientation), + G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); + } + } else if (g_strcmp0(method, "ApplicationSecondaryActivateEvent") == 0) { + guint time; + + g_variant_get (params, "(&s&su)", &dbusaddress, &dbusmenuobject, &time); + app = find_application_by_menu(service, dbusaddress, dbusmenuobject); + + if (app != NULL && app->dbus_proxy != NULL) { + g_dbus_proxy_call(app->dbus_proxy, "XAyatanaSecondaryActivate", + g_variant_new("(u)", time), G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); } } else { @@ -1199,6 +1202,28 @@ find_application (ApplicationServiceAppstore * appstore, const gchar * address, return NULL; } +/* Looks for an application in the list of applications with the matching menu */ +static Application * +find_application_by_menu (ApplicationServiceAppstore * appstore, const gchar * address, const gchar * menuobject) +{ + g_return_val_if_fail(appstore, NULL); + g_return_val_if_fail(address, NULL); + g_return_val_if_fail(menuobject, NULL); + + ApplicationServiceAppstorePrivate * priv = appstore->priv; + GList *l; + + for (l = priv->applications; l != NULL; l = l->next) { + Application *a = l->data; + if (g_strcmp0(a->dbus_name, address) == 0 && + g_strcmp0(a->menu, menuobject) == 0) { + return a; + } + } + + return NULL; +} + /* Removes an application. Currently only works for the apps that are shown. */ void @@ -1276,9 +1301,9 @@ get_applications (ApplicationServiceAppstore * appstore) out = g_variant_builder_end(&builder); } else { GError * error = NULL; - out = g_variant_parse(g_variant_type_new("a(sisossss)"), "[]", NULL, NULL, &error); + out = g_variant_parse(g_variant_type_new("a(sisosssss)"), "[]", NULL, NULL, &error); if (error != NULL) { - g_warning("Unable to parse '[]' as a 'a(sisossss)': %s", error->message); + g_warning("Unable to parse '[]' as a 'a(sisosssss)': %s", error->message); out = NULL; g_error_free(error); } diff --git a/src/application-service.xml b/src/application-service.xml index 1cffbc7..434cfd8 100644 --- a/src/application-service.xml +++ b/src/application-service.xml @@ -34,6 +34,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>. <arg type="i" name="delta" direction="in" /> <arg type="u" name="direction" direction="in" /> </method> + <method name="ApplicationSecondaryActivateEvent"> + <arg type="s" name="dbusaddress" direction="in" /> + <arg type="s" name="dbusobject" direction="in" /> + <arg type="u" name="time" direction="in" /> + </method> <!-- Signals --> <signal name="ApplicationAdded"> diff --git a/src/gen-application-service.xml.c b/src/gen-application-service.xml.c index e3ae1c7..adf7eef 100644 --- a/src/gen-application-service.xml.c +++ b/src/gen-application-service.xml.c @@ -35,6 +35,11 @@ const char * _application_service = " <arg type=\"i\" name=\"delta\" direction=\"in\" />\n" " <arg type=\"u\" name=\"direction\" direction=\"in\" />\n" " </method>\n" +" <method name=\"ApplicationSecondaryActivateEvent\">\n" +" <arg type=\"s\" name=\"dbusaddress\" direction=\"in\" />\n" +" <arg type=\"s\" name=\"dbusobject\" direction=\"in\" />\n" +" <arg type=\"u\" name=\"time\" direction=\"in\" />\n" +" </method>\n" "\n" "<!-- Signals -->\n" " <signal name=\"ApplicationAdded\">\n" 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); |