}
hints_observe_input(FALSE);
+
+ /* simulate the mouse out of the last focused hint */
+ g_signal_emit_by_name(vp.gui.webview, "hovering-over-link", NULL, NULL);
}
void hints_create(const gchar* input, guint mode, const guint prefixLength)
doc = webkit_dom_node_get_owner_document(WEBKIT_DOM_NODE(hint->elem));
dom_dispatch_mouse_event(doc, hint->elem, "mouseover", 0);
webkit_dom_element_blur(hint->elem);
+
+ const gchar* tag = webkit_dom_element_get_tag_name(hint->elem);
+ if (!g_ascii_strcasecmp(tag, "a")) {
+ /* simulate the hovering over the hinted element this is done to show
+ * the hinted elements url in the url bar */
+ g_signal_emit_by_name(
+ vp.gui.webview,
+ "hovering-over-link",
+ "",
+ dom_element_get_source(hint->elem)
+ );
+ } else {
+ /* if hinted element has no url unhover the previous element */
+ g_signal_emit_by_name(vp.gui.webview, "hovering-over-link", NULL, NULL);
+ }
}
vp.hints.focusNum = num;
WebKitWebNavigationAction* navig, WebKitWebPolicyDecision* policy, gpointer data);
static WebKitWebView* vp_create_new_webview_cb(WebKitWebView* webview, WebKitWebFrame* frame, gpointer data);
static void vp_create_new_webview_uri_cb(WebKitWebView* view, GParamSpec param_spec);
-static void vp_hover_link_cb(WebKitWebView* webview, const gchar* titl, const char* link, gpointer data);
+static void vp_hover_link_cb(WebKitWebView* webview, const gchar* title, const char* link, gpointer data);
/* functions */
static gboolean vp_process_input(const char* input);
vp_load_uri(&a);
}
-static void vp_hover_link_cb(WebKitWebView* webview, const gchar* titl, const char* link, gpointer data)
+static void vp_hover_link_cb(WebKitWebView* webview, const gchar* title, const char* link, gpointer data)
{
if (link) {
gchar* message = g_strdup_printf("Link: %s", link);