[epiphany/mcatanzaro/#1800: 86/86] Fix file chooser hang when importing bookmarks




commit 1cf72e79e97b047aa22e0a4a50e688bbb2e30fae
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Fri Jun 3 16:11:19 2022 -0500

    Fix file chooser hang when importing bookmarks
    
    We're setting the wrong parent widget, and not destroying the previous
    dialog properly.

 src/window-commands.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/window-commands.c b/src/window-commands.c
index 6432939e5..66122e167 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -508,10 +508,11 @@ dialog_bookmarks_import_from_chromium (GtkWindow *parent)
 }
 
 static void
-dialog_bookmarks_import_cb (GtkWindow       *parent,
+dialog_bookmarks_import_cb (GtkDialog       *dialog,
                             GtkResponseType  response,
                             GtkComboBox     *combo_box)
 {
+  GtkWindow *parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (dialog)));
   const char *active;
 
   if (response == GTK_RESPONSE_OK) {
@@ -528,9 +529,9 @@ dialog_bookmarks_import_cb (GtkWindow       *parent,
       dialog_bookmarks_import_from_chromium (parent);
     else
       g_assert_not_reached ();
-  } else if (response == GTK_RESPONSE_CANCEL) {
-    gtk_widget_destroy (GTK_WIDGET (parent));
   }
+
+  gtk_widget_destroy (GTK_WIDGET (dialog));
 }
 
 void
@@ -758,9 +759,9 @@ dialog_passwords_import_cb (GtkDialog   *dialog,
       ephy_password_import_from_chrome_async (manager, CHROMIUM, dialog_password_import_cb, dialog);
     else
       g_assert_not_reached ();
-  } else {
-    gtk_widget_destroy (GTK_WIDGET (dialog));
   }
+
+  gtk_widget_destroy (GTK_WIDGET (dialog));
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]