commit: 1f94afe441c6b4ba0700923ed9a1475f091e2364
parent 404358779b24f0c4b54cdd63a9aa9c8d4d7f01c2
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 13 Jun 2019 02:51:37 +0200
only display mouse hover uri when it is a link
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git 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