[epiphany] Revert "Keep window open when closing the last tab"



commit 0d877ab30e00b6cec2c4c3b53842221ccc73690d
Author: Michael Catanzaro <mcatanzaro posteo net>
Date:   Fri Dec 21 19:02:36 2018 +0000

    Revert "Keep window open when closing the last tab"
    
    This reverts commit 1519ffc4cdef26f220a80ade759cd67d631a0981

 src/ephy-window.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 5afd29876..10bf1a499 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2648,14 +2648,16 @@ ephy_window_close_tab (EphyWindow *window,
   if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tab), "ephy-window-close-tab-closed")))
     return;
 
-  if (gtk_notebook_get_n_pages (window->notebook) > 1) {
-    g_object_set_data (G_OBJECT (tab), "ephy-window-close-tab-closed", GINT_TO_POINTER (TRUE));
-    gtk_widget_destroy (GTK_WIDGET (tab));
-  } else {
-    EphyWebView *web_view = ephy_embed_get_web_view (tab);
+  g_object_set_data (G_OBJECT (tab), "ephy-window-close-tab-closed", GINT_TO_POINTER (TRUE));
+  gtk_widget_destroy (GTK_WIDGET (tab));
 
-    ephy_web_view_load_url (web_view, "about:overview");
-  }
+  /* If that was the last tab, destroy the window.
+   *
+   * Beware: window->closing could be true now, after destroying the
+   * tab, even if it wasn't at the start of this function.
+   */
+  if (!window->closing && gtk_notebook_get_n_pages (window->notebook) == 0)
+   gtk_widget_destroy (GTK_WIDGET (window));
 }
 
 typedef struct {


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