aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c18
-rw-r--r--src/empathy-main-window.c4
2 files changed, 13 insertions, 9 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 582ce696e..ddb5d24e6 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -506,10 +506,9 @@ contact_list_view_key_press_event_cb (EmpathyContactListView *view,
}
static void
-contact_list_view_row_activated_cb (EmpathyContactListView *view,
- GtkTreePath *path,
- GtkTreeViewColumn *col,
- gpointer user_data)
+contact_list_view_row_activated (GtkTreeView *view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column)
{
EmpathyContactListViewPriv *priv = GET_PRIV (view);
EmpathyContact *contact;
@@ -528,6 +527,7 @@ contact_list_view_row_activated_cb (EmpathyContactListView *view,
/* There is no event for the contact, default action is starting a chat */
if (priv->contact_features & EMPATHY_CONTACT_FEATURE_CHAT) {
+ DEBUG ("Starting a chat");
empathy_dispatcher_chat_with_contact (contact);
}
@@ -1027,8 +1027,9 @@ contact_list_view_set_property (GObject *object,
static void
empathy_contact_list_view_class_init (EmpathyContactListViewClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkTreeViewClass *tree_view_class = GTK_TREE_VIEW_CLASS (klass);
object_class->finalize = contact_list_view_finalize;
object_class->get_property = contact_list_view_get_property;
@@ -1041,6 +1042,8 @@ empathy_contact_list_view_class_init (EmpathyContactListViewClass *klass)
widget_class->drag_end = contact_list_view_drag_end;
widget_class->drag_motion = contact_list_view_drag_motion;
+ tree_view_class->row_activated = contact_list_view_row_activated;
+
signals[DRAG_CONTACT_RECEIVED] =
g_signal_new ("drag-contact-received",
G_OBJECT_CLASS_TYPE (klass),
@@ -1099,9 +1102,6 @@ empathy_contact_list_view_init (EmpathyContactListView *view)
g_signal_connect (view, "key-press-event",
G_CALLBACK (contact_list_view_key_press_event_cb),
NULL);
- g_signal_connect (view, "row-activated",
- G_CALLBACK (contact_list_view_row_activated_cb),
- NULL);
g_signal_connect (view, "row-expanded",
G_CALLBACK (contact_list_view_row_expand_or_collapse_cb),
GINT_TO_POINTER (TRUE));
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 577f45bb3..371d9d1e9 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -352,7 +352,11 @@ main_window_row_activated_cb (EmpathyContactListView *view,
EmpathyEvent *event = l->data;
if (event->contact == contact) {
+ DEBUG ("Activate event");
empathy_event_activate (event);
+
+ /* We don't want the default handler of this signal */
+ g_signal_stop_emission_by_name (view, "row-activated");
break;
}
}