[epiphany/gnome-3-34] Do not show tab open warning during session closing



commit 2783a4acfa8214693c793a759ed20029d7b921c3
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Thu Feb 13 19:46:27 2020 +0000

    Do not show tab open warning during session closing
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/1093
    
    
    (cherry picked from commit 2c0125617f05411de8a487887a184ac72a716388)

 src/ephy-session.c | 6 ++++++
 src/ephy-session.h | 1 +
 src/ephy-window.c  | 4 ++++
 3 files changed, 11 insertions(+)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 6e6033530..c3b9cfe6a 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -1771,3 +1771,9 @@ ephy_session_clear (EphySession *session)
 
   ephy_session_save (session);
 }
+
+gboolean
+ephy_session_is_closing (EphySession *session)
+{
+  return session->closing;
+}
diff --git a/src/ephy-session.h b/src/ephy-session.h
index c4d82520c..c4ce61fa7 100644
--- a/src/ephy-session.h
+++ b/src/ephy-session.h
@@ -69,5 +69,6 @@ gboolean         ephy_session_get_can_undo_tab_closed (EphySession *session);
 
 void             ephy_session_clear                   (EphySession *session);
 
+gboolean         ephy_session_is_closing              (EphySession *session);
 
 G_END_DECLS
diff --git a/src/ephy-window.c b/src/ephy-window.c
index f3557a954..f69010038 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -4249,6 +4249,8 @@ ephy_window_check_modified_forms (EphyWindow *window)
 gboolean
 ephy_window_close (EphyWindow *window)
 {
+  EphySession *session;
+
   /* We ignore the delete_event if the disable_quit lockdown has been set
    */
   if (g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
@@ -4269,8 +4271,10 @@ ephy_window_close (EphyWindow *window)
     return FALSE;
   }
 
+  session = ephy_shell_get_session (ephy_shell_get_default ());
   if (ephy_shell_get_n_windows (ephy_shell_get_default ()) > 1 &&
       gtk_notebook_get_n_pages (window->notebook) > 1 &&
+      !ephy_session_is_closing (session) &&
       !confirm_close_with_multiple_tabs (window)) {
     /* stop window close */
     return FALSE;


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