[telepathy-mission-control/master] mcd_dispatch_operation_handle_channels: set user action time to the most recent time among all requests' action times, and the time that HandleWith() was called
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Oct 20 14:51:06 PDT 2009
The user action time is intended for focus-stealing prevention; we
want to set it to the time of the most recent user action, so that the
window popping up via gtk_window_present_with_time (or whatever) will
take focus if and only if the user hasn't done anything else since they
caused it to pop up.
---
src/mcd-dispatch-operation.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index bf138dc..43599a9 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -93,6 +93,7 @@ struct _McdDispatchOperationPrivate
/* if TRUE, we will emit finished as soon as we can */
gboolean wants_to_finish;
gchar *handler;
+ gint64 handle_with_time;
gchar *claimer;
DBusGMethodInvocation *claim_context;
@@ -495,6 +496,7 @@ dispatch_operation_handle_with (TpSvcChannelDispatchOperation *cdo,
{
GError *error = NULL;
McdDispatchOperation *self = MCD_DISPATCH_OPERATION (cdo);
+ GTimeVal now = { 0, 0 };
DEBUG ("%s/%p", self->priv->unique_name, self);
@@ -505,6 +507,9 @@ dispatch_operation_handle_with (TpSvcChannelDispatchOperation *cdo,
return;
}
+ g_get_current_time (&now);
+ self->priv->handle_with_time = now.tv_sec;
+
if (handler_name != NULL && handler_name[0] != '\0')
{
self->priv->handler = g_strdup (handler_name +
@@ -1666,7 +1671,7 @@ mcd_dispatch_operation_handle_channels (McdDispatchOperation *self,
account_path = _mcd_dispatch_operation_get_account_path (self);
- user_action_time = 0; /* TODO: if we have a CDO, get it from there */
+ user_action_time = self->priv->handle_with_time;
satisfied_requests = g_ptr_array_new ();
for (cl = self->priv->channels; cl != NULL; cl = cl->next)
--
1.5.6.5
More information about the telepathy-commits
mailing list