GApplication: send platform data for actions again

Use the _full variants of the GDBusActionGroup API to send platform data
for action invocations once again.
This commit is contained in:
Ryan Lortie 2011-12-16 22:24:03 -05:00
parent f58df66d4d
commit ee9f104432
3 changed files with 39 additions and 9 deletions

View File

@ -1646,12 +1646,11 @@ g_application_change_action_state (GActionGroup *action_group,
g_return_if_fail (application->priv->is_registered);
if (application->priv->remote_actions)
return g_action_group_change_action_state (application->priv->remote_actions,
action_name, value);
g_application_impl_change_action_state (application->priv->impl, action_name, value,
get_platform_data (application));
else
g_action_group_change_action_state (application->priv->actions,
action_name, value);
g_action_group_change_action_state (application->priv->actions, action_name, value);
}
static void
@ -1665,13 +1664,12 @@ g_application_activate_action (GActionGroup *action_group,
application->priv->actions != NULL);
g_return_if_fail (application->priv->is_registered);
if (application->priv->remote_actions)
return g_action_group_activate_action (application->priv->remote_actions,
action_name, parameter);
if (application->priv->is_remote)
g_application_impl_activate_action (application->priv->impl, action_name, parameter,
get_platform_data (application));
else
g_action_group_activate_action (application->priv->actions,
action_name, parameter);
g_action_group_activate_action (application->priv->actions, action_name, parameter);
}
static GAction *

View File

@ -86,6 +86,7 @@ static GDBusInterfaceInfo *org_gtk_private_CommandLine;
struct _GApplicationImpl
{
GDBusConnection *session_bus;
GDBusActionGroup *remote_actions;
const gchar *bus_name;
gchar *object_path;
@ -543,6 +544,7 @@ g_application_impl_register (GApplication *application,
}
*remote_actions = G_ACTION_GROUP (actions);
impl->remote_actions = actions;
return impl;
}
@ -591,6 +593,24 @@ g_application_impl_open (GApplicationImpl *impl,
NULL, 0, -1, NULL, NULL, NULL);
}
void
g_application_impl_activate_action (GApplicationImpl *impl,
const gchar *action_name,
GVariant *parameter,
GVariant *platform_data)
{
g_dbus_action_group_activate_action_full (impl->remote_actions, action_name, parameter, platform_data);
}
void
g_application_impl_change_action_state (GApplicationImpl *impl,
const gchar *action_name,
GVariant *value,
GVariant *platform_data)
{
g_dbus_action_group_change_action_state_full (impl->remote_actions, action_name, value, platform_data);
}
static void
g_application_impl_cmdline_method_call (GDBusConnection *connection,
const gchar *sender,

View File

@ -33,6 +33,18 @@ void g_application_impl_open (GApplic
const gchar *hint,
GVariant *platform_data);
G_GNUC_INTERNAL
void g_application_impl_activate_action (GApplicationImpl *impl,
const gchar *action_name,
GVariant *parameter,
GVariant *platform_data);
G_GNUC_INTERNAL
void g_application_impl_change_action_state (GApplicationImpl *impl,
const gchar *action_name,
GVariant *value,
GVariant *platform_data);
G_GNUC_INTERNAL
int g_application_impl_command_line (GApplicationImpl *impl,
gchar **arguments,