summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2013-02-09 12:54:21 +0100
committerportix <none@none>2013-02-09 12:54:21 +0100
commite4d5721a9e18aac5528b49697fc3259dd38cbb52 (patch)
tree493e731f6021d559a4e542ef339969eec5beb79c /src
parentc2d77cba544943dd64fad83d399fadbf8b184efc (diff)
downloaddwb-e4d5721a9e18aac5528b49697fc3259dd38cbb52.zip
Update tab title of tabs that hasn't been loaded
Diffstat (limited to 'src')
-rw-r--r--src/dwb.c13
-rw-r--r--src/view.c4
2 files changed, 7 insertions, 10 deletions
diff --git a/src/dwb.c b/src/dwb.c
index 0d8aeff9..e377f6d6 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -2253,11 +2253,12 @@ dwb_tab_label_set_text(GList *gl, const char *text)
if (v->status->progress != 0)
snprintf(progress, sizeof(progress), "[%2d%%] ", v->status->progress);
- escaped = g_markup_printf_escaped("<span foreground='%s'>%d%s</span> %s%s",
+ escaped = g_markup_printf_escaped("<span foreground='%s'>%d%s</span> %s%s%s",
LP_PROTECTED(v) ? dwb.color.tab_protected_color : dwb.color.tab_number_color,
g_list_position(dwb.state.views, gl) + 1,
LP_VISIBLE(v) ? "*" : "",
progress,
+ v->status->deferred ? "*" : "",
title ? title : "---");
gtk_label_set_markup(GTK_LABEL(v->tablabel), escaped);
@@ -2298,14 +2299,12 @@ dwb_update_status(GList *gl, const char *title)
void
dwb_update_layout()
{
+ const char *title;
for (GList *gl = dwb.state.views; gl; gl = gl->next)
{
- if (!VIEW(gl)->status->deferred)
- {
- View *v = gl->data;
- const char *title = webkit_web_view_get_title(WEBKIT_WEB_VIEW(v->web));
- dwb_tab_label_set_text(gl, title);
- }
+ View *v = gl->data;
+ title = v->status->deferred ? v->status->deferred_uri : webkit_web_view_get_title(WEBKIT_WEB_VIEW(v->web));
+ dwb_tab_label_set_text(gl, title);
}
dwb_update_tabs();
diff --git a/src/view.c b/src/view.c
index 7f3b64e5..a163b734 100644
--- a/src/view.c
+++ b/src/view.c
@@ -491,15 +491,13 @@ view_navigation_policy_cb(WebKitWebView *web, WebKitWebFrame *frame, WebKitNetwo
{
if (gl != dwb.state.fview)
{
- char buffer[128];
const char *stripped;
VIEW(gl)->status->deferred_uri = g_strdup(uri);
stripped = strstr(uri, "://");
- snprintf(buffer, sizeof(buffer), "*%s", stripped ? stripped + 3 : uri);
- dwb_tab_label_set_text(gl, buffer);
+ dwb_tab_label_set_text(gl, stripped ? stripped + 3 : uri);
webkit_web_policy_decision_ignore(policy);
return true;
}