aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 8b70cf6c1..d7c65dd45 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -685,7 +685,6 @@ static gboolean
confirm_close_with_modified_forms (EphyWindow *window)
{
GtkWidget *dialog;
- GtkWindowGroup *group;
int response;
dialog = gtk_message_dialog_new
@@ -708,15 +707,7 @@ confirm_close_with_modified_forms (EphyWindow *window)
/* FIXME set title */
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
- group = GTK_WINDOW (window)->group;
- if (group == NULL)
- {
- group = gtk_window_group_new ();
- gtk_window_group_add_window (group, GTK_WINDOW (window));
- g_object_unref (group);
- }
-
- gtk_window_group_add_window (group, GTK_WINDOW (dialog));
+ gtk_window_group_add_window (GTK_WINDOW (window)->group, GTK_WINDOW (dialog));
response = gtk_dialog_run (GTK_DIALOG (dialog));
@@ -2366,6 +2357,20 @@ open_bookmark_cb (EphyBookmarksMenu *menu,
}
static void
+ensure_window_group (EphyWindow *window)
+{
+ GtkWindowGroup *group;
+
+ group = GTK_WINDOW (window)->group;
+ if (group == NULL)
+ {
+ group = gtk_window_group_new ();
+ gtk_window_group_add_window (group, GTK_WINDOW (window));
+ g_object_unref (group);
+ }
+}
+
+static void
ephy_window_init (EphyWindow *window)
{
EphyExtension *manager;
@@ -2380,6 +2385,8 @@ ephy_window_init (EphyWindow *window)
g_object_ref (ephy_shell);
+ ensure_window_group (window);
+
/* Setup the UI manager and connect verbs */
setup_ui_manager (window);