From c14d50f1da273620944f2f60a3af43d3d9f35c57 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 13 Apr 2019 20:29:34 +0200 Subject: WebViewCb_web_process_terminated: Change tab’s title with the reason MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- badwolf.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/badwolf.c b/badwolf.c index 7c24ae0..502dfce 100644 --- a/badwolf.c +++ b/badwolf.c @@ -87,19 +87,18 @@ static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView, WebKitWebProcessTerminationReason reason) { (void)webView; - char *str_reason; switch(reason) { - case WEBKIT_WEB_PROCESS_CRASHED: str_reason = "the web process crashed."; break; + case WEBKIT_WEB_PROCESS_CRASHED: g_fprintf(stderr, "the web process crashed."; webView_tab_label_change(browser, "Crashed"); break; case WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT: - str_reason = "the web process exceeded the memory limit."; + g_fprintf(stderr, "the web process exceeded the memory limit."; + webView_tab_label_change(browser, "Out of Memory"); break; - default: str_reason = "the web process terminated for an unknown reason."; + default: g_fprintf(stderr, "the web process terminated for an unknown reason."); + webView_tab_label_change(browser, "Unknown Crash"); } - g_fprintf(stderr, "BadWolf [signal: web-process-terminated]: %s\n", str_reason); - return FALSE; } -- cgit v1.3.1-23-gd82d