From 016d0d328eab55b814f0c8d1bffcdf25a089c5b5 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 23 Mar 2018 12:17:12 +0100 Subject: [PATCH] Set transient parent for the "Full Name" editor dialog --- src/addressbook/gui/contact-editor/e-contact-editor-fullname.c | 7 +++++-- src/addressbook/gui/contact-editor/e-contact-editor-fullname.h | 3 ++- src/addressbook/gui/contact-editor/e-contact-editor.c | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/src/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 076365d15f..e91c90c072 100644 --- a/src/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/src/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -247,9 +247,12 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam } GtkWidget * -e_contact_editor_fullname_new (const EContactName *name) +e_contact_editor_fullname_new (GtkWindow *parent, + const EContactName *name) { - GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, NULL); + GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, + "transient-for", parent, + NULL); g_object_set ( widget, diff --git a/src/addressbook/gui/contact-editor/e-contact-editor-fullname.h b/src/addressbook/gui/contact-editor/e-contact-editor-fullname.h index 3d3cb22255..ffdd85fecb 100644 --- a/src/addressbook/gui/contact-editor/e-contact-editor-fullname.h +++ b/src/addressbook/gui/contact-editor/e-contact-editor-fullname.h @@ -62,7 +62,8 @@ struct _EContactEditorFullnameClass GtkDialogClass parent_class; }; -GtkWidget *e_contact_editor_fullname_new (const EContactName *name); +GtkWidget *e_contact_editor_fullname_new (GtkWindow *parent, + const EContactName *name); GType e_contact_editor_fullname_get_type (void); G_END_DECLS diff --git a/src/addressbook/gui/contact-editor/e-contact-editor.c b/src/addressbook/gui/contact-editor/e-contact-editor.c index 571be7dde9..cbc19b5419 100644 --- a/src/addressbook/gui/contact-editor/e-contact-editor.c +++ b/src/addressbook/gui/contact-editor/e-contact-editor.c @@ -4102,6 +4102,7 @@ full_name_clicked (GtkWidget *button, EContactEditor *editor) { GtkDialog *dialog; + GtkWindow *parent; gboolean fullname_supported; if (editor->priv->fullname_dialog) { @@ -4109,7 +4110,8 @@ full_name_clicked (GtkWidget *button, return; } - dialog = GTK_DIALOG (e_contact_editor_fullname_new (editor->priv->name)); + parent = eab_editor_get_window (EAB_EDITOR (editor)); + dialog = GTK_DIALOG (e_contact_editor_fullname_new (parent, editor->priv->name)); fullname_supported = is_field_supported (editor, E_CONTACT_FULL_NAME); g_object_set ( -- 2.11.4.GIT