From 0f0cbb7b97c7f3d7e8c215f65b38f9ba065cbb84 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Sun, 16 Dec 2012 19:33:36 +0100
Subject: [PATCH] Dispatch mouseover and mouseout event when focus elements by
 hinting.

---
 src/hints.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/hints.c b/src/hints.c
index e241cfc..47881a6 100644
--- a/src/hints.c
+++ b/src/hints.c
@@ -291,16 +291,23 @@ static void hints_create_for_window(
 
 static void hints_focus(const gulong num)
 {
+    /* TODO use the document the hinted element belongs to */
+    Document* doc = webkit_web_view_get_dom_document(vp.gui.webview);
     Hint* hint = hints_get_hint_by_number(currentFocusNum);
     if (hint) {
         /* reset previous focused element */
         dom_element_style_set_property(hint->elem, "background-color", ELEM_BACKGROUND);
+
+        dom_dispatch_mouse_event(doc, hint->elem, "mouseout", 0);
     }
 
     hint = hints_get_hint_by_number(num);
     if (hint) {
         /* mark new hint as focused */
         dom_element_style_set_property(hint->elem, "background-color", ELEM_BACKGROUND_FOCUS);
+
+        dom_dispatch_mouse_event(doc, hint->elem, "mouseover", 0);
+        webkit_dom_element_focus(hint->elem);
     }
 
     currentFocusNum = num;
-- 
2.20.1