From 9d8d2acedf71b890c7bf0ff94f28b317b3ec1b9a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 16 Jun 2019 05:22:19 +0200 Subject: Release 0.2.1 --- badwolf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'badwolf.c') diff --git a/badwolf.c b/badwolf.c index b91d4da..62eb9ea 100644 --- a/badwolf.c +++ b/badwolf.c @@ -12,7 +12,7 @@ #include const gchar *homepage = "https://hacktivis.me/projects/badwolf"; -const gchar *version = "0.2.0"; +const gchar *version = "0.2.1"; struct Window { -- cgit v1.3.1-23-gd82d From bfc4e50960f19156cb644015b185d14efdd9d55c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 17 May 2019 12:57:30 +0200 Subject: Bugfix: correctly use initialized web_context --- badwolf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'badwolf.c') diff --git a/badwolf.c b/badwolf.c index 62eb9ea..62cfc79 100644 --- a/badwolf.c +++ b/badwolf.c @@ -550,7 +550,7 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web browser->webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, "web-context", - webkit_web_context_new_ephemeral(), + web_context, "related-view", related_web_view, "settings", -- cgit v1.3.1-23-gd82d From bdcf4d1bda0c8c3efacfeaf8a8b75f64acd4a26a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 18 May 2019 17:15:13 +0200 Subject: badwolf.c: Fix usage of ensure_uri_scheme try_file argument --- badwolf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'badwolf.c') diff --git a/badwolf.c b/badwolf.c index 62cfc79..fef7d36 100644 --- a/badwolf.c +++ b/badwolf.c @@ -456,7 +456,7 @@ locationCb_activate(GtkEntry *location, gpointer user_data) char *target_url; struct Client *browser = (struct Client *)user_data; - target_url = ensure_uri_scheme((char *)gtk_entry_get_text(location), FALSE); + target_url = ensure_uri_scheme((char *)gtk_entry_get_text(location), TRUE); if(target_url != NULL) webkit_web_view_load_uri(browser->webView, target_url); @@ -530,7 +530,7 @@ struct Client * new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web_view) { struct Client *browser = g_malloc(sizeof(struct Client)); - target_url = ensure_uri_scheme(target_url, (related_web_view != NULL)); + target_url = ensure_uri_scheme(target_url, (related_web_view == NULL)); browser->window = window; browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); -- cgit v1.3.1-23-gd82d From 401c239d9be8d9162fd4459eb195bfd5b91369d1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 14 Jun 2019 05:59:02 +0200 Subject: Sync & init the menu-label of a tab with it’s title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- badwolf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'badwolf.c') diff --git a/badwolf.c b/badwolf.c index fef7d36..2d4d8df 100644 --- a/badwolf.c +++ b/badwolf.c @@ -369,7 +369,9 @@ webView_tab_label_change(struct Client *browser, const gchar *title) gtk_notebook_set_tab_label( GTK_NOTEBOOK(notebook), browser->box, badwolf_new_tab_box(title, browser)); + gtk_notebook_set_menu_label_text(GTK_NOTEBOOK(notebook), browser->box, title); + // Set the window title if the title change was on the current tab if(get_tab_position(GTK_CONTAINER(notebook), browser->box) == gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))) gtk_window_set_title(GTK_WINDOW(browser->window->main_window), title); @@ -657,6 +659,7 @@ badwolf_new_tab(GtkNotebook *notebook, struct Client *browser) gtk_notebook_set_tab_reorderable(notebook, browser->box, TRUE); gtk_notebook_set_tab_label(notebook, browser->box, badwolf_new_tab_box(title, browser)); + gtk_notebook_set_menu_label_text(GTK_NOTEBOOK(notebook), browser->box, title); gtk_widget_queue_draw(GTK_WIDGET(notebook)); -- cgit v1.3.1-23-gd82d From b3426f0fe4b262bda2473ad142e5099f0436e5dd Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 17 Jun 2019 06:36:00 +0200 Subject: Bugfix: don't abort on malloc failure --- badwolf.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'badwolf.c') diff --git a/badwolf.c b/badwolf.c index 2d4d8df..d882547 100644 --- a/badwolf.c +++ b/badwolf.c @@ -531,9 +531,11 @@ SearchEntryCb_stop__search(GtkSearchEntry *search, gpointer user_data) struct Client * new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web_view) { - struct Client *browser = g_malloc(sizeof(struct Client)); + struct Client *browser = g_try_malloc(sizeof(struct Client)); target_url = ensure_uri_scheme(target_url, (related_web_view == NULL)); + if(browser == NULL) return NULL; + browser->window = window; browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); browser->toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); @@ -644,12 +646,21 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web return browser; } +/* badwolf_new_tab: Inserts struct Client *browser in GtkNotebook *notebook + * + * returns: + * 0 : Ran successfully + * -1 : Failed to insert a page for browser->box + * -2 : browser is NULL + */ int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser) { gint current_page = gtk_notebook_get_current_page(notebook); gchar *title = _("New tab"); + if(browser == NULL) return -2; + gtk_widget_show_all(browser->box); if(gtk_notebook_insert_page(notebook, browser->box, NULL, (current_page + 2)) == -1) @@ -710,6 +721,7 @@ get_tab_position(GtkContainer *notebook, GtkWidget *child) int main(int argc, char *argv[]) { + // getting an abort if this one fails to alloc struct Window *window = g_malloc(sizeof(struct Client)); gchar *target_url = NULL; -- cgit v1.3.1-23-gd82d From a7976a3530a69823ceff4b58773886c3e15a5d6c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 17 Jun 2019 06:38:40 +0200 Subject: Bugfix: fix wrong argument to sizeof for *window g_malloc --- badwolf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'badwolf.c') diff --git a/badwolf.c b/badwolf.c index d882547..67979b7 100644 --- a/badwolf.c +++ b/badwolf.c @@ -722,7 +722,7 @@ int main(int argc, char *argv[]) { // getting an abort if this one fails to alloc - struct Window *window = g_malloc(sizeof(struct Client)); + struct Window *window = g_malloc(sizeof(struct Window)); gchar *target_url = NULL; setlocale(LC_ALL, ""); -- cgit v1.3.1-23-gd82d From 1f94afe441c6b4ba0700923ed9a1475f091e2364 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 13 Jun 2019 02:51:37 +0200 Subject: only display mouse hover uri when it is a link --- badwolf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'badwolf.c') diff --git a/badwolf.c b/badwolf.c index 67979b7..cecfb96 100644 --- a/badwolf.c +++ b/badwolf.c @@ -406,11 +406,17 @@ WebViewCb_mouse_target_changed(WebKitWebView *webView, (void)webView; (void)modifiers; struct Client *browser = (struct Client *)user_data; - const gchar *link_uri = webkit_hit_test_result_get_link_uri(hit); - gtk_label_set_text(GTK_LABEL(browser->statuslabel), webkit_uri_for_display(link_uri)); + if(webkit_hit_test_result_context_is_link(hit)) + { + const gchar *link_uri = webkit_hit_test_result_get_link_uri(hit); - return TRUE; + gtk_label_set_text(GTK_LABEL(browser->statuslabel), webkit_uri_for_display(link_uri)); + } + else + gtk_label_set_text(GTK_LABEL(browser->statuslabel), NULL); + + return FALSE; } static gboolean -- cgit v1.3.1-23-gd82d From 582b91d23bd1eba52f77ba1cc68a21f8061ea50a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 21 Jun 2019 00:28:59 +0200 Subject: badwolf.c: Try +1 on current_page when creating a tab again --- badwolf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'badwolf.c') diff --git a/badwolf.c b/badwolf.c index cecfb96..2ba2bda 100644 --- a/badwolf.c +++ b/badwolf.c @@ -669,7 +669,7 @@ badwolf_new_tab(GtkNotebook *notebook, struct Client *browser) gtk_widget_show_all(browser->box); - if(gtk_notebook_insert_page(notebook, browser->box, NULL, (current_page + 2)) == -1) + if(gtk_notebook_insert_page(notebook, browser->box, NULL, (current_page + 1)) == -1) { return -1; } -- cgit v1.3.1-23-gd82d