[epiphany] pages-popover: Use tab-close-request signal to close a tab



commit 45731e91657ff11ac2debdfef5ebf45d5cfb83cb
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Sun Jul 7 22:58:25 2019 +0200

    pages-popover: Use tab-close-request signal to close a tab
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/637

 src/ephy-pages-view.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-pages-view.c b/src/ephy-pages-view.c
index 77b9e8741..0cf78a24c 100644
--- a/src/ephy-pages-view.c
+++ b/src/ephy-pages-view.c
@@ -94,11 +94,21 @@ static void
 row_closed_cb (EphyPagesView *self,
                EphyPageRow   *row)
 {
+  GtkWindow *window;
+  GtkWidget *embed;
+  EphyEmbedShell *shell;
+
   g_assert (EPHY_IS_PAGES_VIEW (self));
   g_assert (EPHY_IS_PAGE_ROW (row));
 
-  gtk_notebook_remove_page (GTK_NOTEBOOK (self->notebook),
-                            gtk_list_box_row_get_index (GTK_LIST_BOX_ROW (row)));
+  shell = ephy_embed_shell_get_default ();
+  window = gtk_application_get_active_window (GTK_APPLICATION (shell));
+
+  embed = gtk_notebook_get_nth_page (GTK_NOTEBOOK (self->notebook),
+                                     gtk_list_box_row_get_index (GTK_LIST_BOX_ROW (row)));
+  g_signal_emit_by_name (self->notebook,
+                         "tab-close-request",
+                         embed, window);
 }
 
 static void


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