Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitdf054a6cac79d19a27e677ae92f5879d1e675790 (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-03-10 16:58:41 +0100
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-03-10 17:16:18 +0100
Filesb4015f8167786b5551719a795ec6b99c64d7ffec
goodwolf-df054a6cac79d19a27e677ae92f5879d1e675790.tar
goodwolf-df054a6cac79d19a27e677ae92f5879d1e675790.tar.gz
goodwolf-df054a6cac79d19a27e677ae92f5879d1e675790.zip
Parente5ca3b1e8bd68d3199d2874fbc505ee58b83f244 (diff)
badwolf.c: limit characters in tabs
1 files changed, 7 insertions, 0 deletions
-rw-r--r--badwolf.c7
diff --git a/badwolf.c b/badwolf.c
index 7494986..0ad5672 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -98,12 +98,19 @@ WebViewCb_notify__title(WebKitWebView *webView, GParamSpec *pspec, gpointer user
const gchar *title;
struct Client *browser = (struct Client *)user_data;
+#define BADWOLF_TAB_MAXCHARS 16
+
title = webkit_web_view_get_title(browser->webView);
if(title == NULL) title = webkit_web_view_get_uri(browser->webView);
if(title == NULL) title = "BadWolf";
+ if(strlen(title) > BADWOLF_TAB_MAXCHARS)
+ {
+ title = g_strndup(title, BADWOLF_TAB_MAXCHARS);
+ }
+
gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(browser->window->notebook), browser->box, title);
return TRUE;