[epiphany] ephy-session: Save the session also when active tab changes



commit 7d83de2dd3b6645185d31904ec90ae93f25ab680
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Thu Jan 14 15:42:07 2016 +0100

    ephy-session: Save the session also when active tab changes
    
    We are saving the active tab in the session, but we don't update the
    session file when it changes.

 src/ephy-session.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index d8a7cad..f081eee 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -382,6 +382,15 @@ notebook_page_reordered_cb (GtkWidget *notebook,
 }
 
 static void
+notebook_switch_page_cb (GtkNotebook *notebook,
+                        GtkWidget   *page,
+                        guint        page_num,
+                        EphySession *session)
+{
+       ephy_session_save (session);
+}
+
+static void
 session_maybe_open_window (EphySession *session,
                           guint32 user_time)
 {
@@ -426,6 +435,8 @@ window_added_cb (GtkApplication *application,
                          G_CALLBACK (notebook_page_removed_cb), session);
        g_signal_connect (notebook, "page-reordered",
                          G_CALLBACK (notebook_page_reordered_cb), session);
+       g_signal_connect_after (notebook, "switch-page",
+                               G_CALLBACK (notebook_switch_page_cb), session);
 
        /* Set unique identifier as role, so that on restore, the WM can
         * place the window on the right workspace


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