aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-menu.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index 44b00165e..5792903c2 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -129,9 +129,16 @@ static void
empathy_contact_add_menu_item_activated (GtkMenuItem *item,
EmpathyContact *contact)
{
- /* FIXME - attempt to get parent */
+ GtkWidget *toplevel;
+
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (item));
+ if (!GTK_WIDGET_TOPLEVEL (toplevel) || !GTK_IS_WINDOW (toplevel)) {
+ toplevel = NULL;
+ }
+
/* FIXME - the contact dialog doesn't set the source account right */
- empathy_new_contact_dialog_show_with_contact (NULL, contact);
+ empathy_new_contact_dialog_show_with_contact (GTK_WINDOW (toplevel),
+ contact);
}
GtkWidget *