From 54ae82bdf32156387e3d720656bd361a859b8db6 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sat, 24 Apr 2010 17:16:32 +0100 Subject: add timestamp arg to empathy_dispatcher_chat_with_contact(_id) --- libempathy-gtk/empathy-chat.c | 3 ++- libempathy-gtk/empathy-contact-list-view.c | 3 ++- libempathy-gtk/empathy-contact-menu.c | 3 ++- libempathy-gtk/empathy-new-message-dialog.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index b06329a67..06ee4bbe7 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -262,7 +262,7 @@ reconnected_connection_ready_cb (TpConnection *connection, switch (priv->handle_type) { case TP_HANDLE_TYPE_CONTACT: empathy_dispatcher_chat_with_contact_id ( - connection, priv->id, + connection, priv->id, EMPATHY_DISPATCHER_NON_USER_ACTION, chat_connect_channel_reconnected, chat); break; @@ -767,6 +767,7 @@ chat_command_msg_internal (EmpathyChat *chat, data->message = g_strdup (message); connection = empathy_tp_chat_get_connection (priv->tp_chat); empathy_dispatcher_chat_with_contact_id (connection, contact_id, + gtk_get_current_event_time (), chat_command_msg_cb, data); } diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index 15df212ce..ae84e3e15 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -804,7 +804,8 @@ contact_list_view_row_activated (GtkTreeView *view, if (contact) { DEBUG ("Starting a chat"); - empathy_dispatcher_chat_with_contact (contact, NULL, NULL); + empathy_dispatcher_chat_with_contact (contact, + gtk_get_current_event_time (), NULL, NULL); g_object_unref (contact); } } diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index fbcd8dc8a..e160f5e20 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -222,7 +222,8 @@ static void empathy_contact_chat_menu_item_activated (GtkMenuItem *item, EmpathyContact *contact) { - empathy_dispatcher_chat_with_contact (contact, NULL, NULL); + empathy_dispatcher_chat_with_contact (contact, gtk_get_current_event_time (), + NULL, NULL); } GtkWidget * diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c index 338da2760..509438575 100644 --- a/libempathy-gtk/empathy-new-message-dialog.c +++ b/libempathy-gtk/empathy-new-message-dialog.c @@ -70,7 +70,8 @@ empathy_new_message_dialog_response (GtkDialog *dialog, int response_id) if (EMP_STR_EMPTY (contact_id) || connection == NULL) goto out; - empathy_dispatcher_chat_with_contact_id (connection, contact_id, NULL, NULL); + empathy_dispatcher_chat_with_contact_id (connection, contact_id, + gtk_get_current_event_time (), NULL, NULL); out: gtk_widget_destroy (GTK_WIDGET (dialog)); -- cgit v1.2.3 From a6748d5d5fd1f37cef6bf26a6256cd299a60a09c Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sat, 24 Apr 2010 17:19:50 +0100 Subject: add timestamp arg to empathy_dispatcher_join_muc --- libempathy-gtk/empathy-chat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 06ee4bbe7..57cf62632 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -268,7 +268,7 @@ reconnected_connection_ready_cb (TpConnection *connection, break; case TP_HANDLE_TYPE_ROOM: empathy_dispatcher_join_muc (connection, - priv->id, + priv->id, EMPATHY_DISPATCHER_NON_USER_ACTION, chat_connect_channel_reconnected, chat); break; @@ -743,6 +743,7 @@ chat_command_join (EmpathyChat *chat, connection = empathy_tp_chat_get_connection (priv->tp_chat); empathy_dispatcher_join_muc (connection, rooms[i], + gtk_get_current_event_time (), chat_command_join_cb, chat); } -- cgit v1.2.3 From c633b9b25a6bd729b8441382332e807d31331a93 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sat, 24 Apr 2010 17:39:39 +0100 Subject: Pass the ChannelDispatcher timestamp onwards to window_present --- libempathy-gtk/empathy-ui-utils.c | 10 ++++++++-- libempathy-gtk/empathy-ui-utils.h | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index 3f37ea2db..70098ad3e 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -1392,10 +1392,10 @@ empathy_window_iconify (GtkWindow *window, GtkStatusIcon *status_icon) /* Takes care of moving the window to the current workspace. */ void -empathy_window_present (GtkWindow *window) +empathy_window_present_with_time (GtkWindow *window, + guint32 timestamp) { GdkWindow *gdk_window; - guint32 timestamp; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -1436,6 +1436,12 @@ empathy_window_present (GtkWindow *window) gtk_window_deiconify (window); } +void +empathy_window_present (GtkWindow *window) +{ + empathy_window_present_with_time (window, GDK_CURRENT_TIME); +} + GtkWindow * empathy_get_toplevel_window (GtkWidget *widget) { diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h index 8834cb4c9..6dab13789 100644 --- a/libempathy-gtk/empathy-ui-utils.h +++ b/libempathy-gtk/empathy-ui-utils.h @@ -104,7 +104,9 @@ gboolean empathy_text_iter_backward_search (const GtkTextIter*iter, const GtkTextIter*limit); /* Windows */ gboolean empathy_window_get_is_visible (GtkWindow *window); -void empathy_window_present (GtkWindow *window); +void empathy_window_present (GtkWindow *window); +void empathy_window_present_with_time (GtkWindow *window, + guint32 timestamp); void empathy_window_iconify (GtkWindow *window, GtkStatusIcon *status_icon); GtkWindow * empathy_get_toplevel_window (GtkWidget *widget); -- cgit v1.2.3 From 9e34e6de9a81e02929cfc65d771a4da6eb348df6 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sat, 24 Apr 2010 18:06:48 +0100 Subject: No longer need to dig out the X time ourselves --- libempathy-gtk/empathy-ui-utils.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index 70098ad3e..2f06ae902 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -1417,20 +1417,6 @@ empathy_window_present_with_time (GtkWindow *window, gtk_widget_hide (GTK_WIDGET (window)); } - timestamp = gtk_get_current_event_time (); - if (timestamp == 0 && gdk_window != NULL) { - GdkEventMask mask; - - /* According to the documentation of gdk_x11_get_server_time - * GDK_PROPERTY_CHANGE_MASK needs to be set in its events otherwise a hang - * can occur. Be sure to at least temporarily set this mask */ - mask = gdk_window_get_events (gdk_window); - gdk_window_set_events (gdk_window, - mask | GDK_PROPERTY_CHANGE_MASK); - timestamp = gdk_x11_get_server_time (gdk_window); - gdk_window_set_events (gdk_window, mask); - } - gtk_window_present_with_time (window, timestamp); gtk_window_set_skip_taskbar_hint (window, FALSE); gtk_window_deiconify (window); -- cgit v1.2.3