[epiphany] window-commands: show a blank page in new tab if the homepage is a blank page



commit fa3a1c5d63c1709ac7d68b5bacfba9cbef67a5be
Author: ignapk <automat script gmail com>
Date:   Thu Jan 9 21:57:57 2020 +0100

    window-commands: show a blank page in new tab if the homepage is a blank page
    
    Currently there is no option to change default new tab content (disable
    Most Visited page)
    
    To fix this issue, make the new tab show a blank page if the homepage
    has been changed to a blank page.
    
    Partially fixes #393

 src/window-commands.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/window-commands.c b/src/window-commands.c
index 0f780a66a..734383ba3 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -880,13 +880,20 @@ window_cmd_new_tab (GSimpleAction *action,
 {
   GtkWidget *stack;
   EphyWindow *window = user_data;
+  char *url;
 
   stack = ephy_window_get_stack (window);
+  url = g_settings_get_string (EPHY_SETTINGS_MAIN, EPHY_PREFS_HOMEPAGE_URL);
+  if (g_strcmp0 (url, "about:blank") != 0) {
+    g_free (url);
+    url = NULL;
+  }
 
   ephy_link_open (EPHY_LINK (window),
-                  NULL, NULL,
+                  url, NULL,
                   EPHY_LINK_NEW_TAB | EPHY_LINK_JUMP_TO);
   gtk_stack_set_visible_child_name (GTK_STACK (stack), "content");
+  g_free (url);
 }
 
 static void


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