From 4272057e7341b630dbe0f33ba5b62d38fb31d776 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 03 Oct 2018 19:08:09 -0400 Subject: MqTabPage: Don't clobber "New Tab" when renaming a new tab --- diff --git a/src/tab-page.c b/src/tab-page.c index 1487c8d..afecdc2 100644 --- a/src/tab-page.c +++ b/src/tab-page.c @@ -45,6 +45,7 @@ struct _MqTabPage { MqApplication *application; guint64 id; GtkWidget *label; + gboolean title_init; const gchar *title; WebKitWebView *web_view; gulong title_handler_id; @@ -69,6 +70,7 @@ static void title_cb(WebKitWebView *web_view, GParamSpec G_GNUC_UNUSED *param_spec, MqTabPage *tab_page) { + tab_page->title_init = TRUE; tab_page->title = webkit_web_view_get_title(web_view); mq_notebook_update_tab_title( MQ_NOTEBOOK(gtk_widget_get_parent(GTK_WIDGET(tab_page))), @@ -297,6 +299,9 @@ mq_tab_page_set_title(MqTabPage *tab_page, const gchar *title) tab_page->title = title; g_signal_handler_block(tab_page->web_view, tab_page->title_handler_id); + } else if (!tab_page->title_init) { + /* Don't clobber "New Tab". */ + return; } else { tab_page->title = webkit_web_view_get_title(tab_page->web_view); g_signal_handler_unblock(tab_page->web_view, -- cgit v0.9.1