Removed code to track clicks to input elements.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 6 Apr 2015 20:09:48 +0000 (22:09 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 6 Apr 2015 20:09:48 +0000 (22:09 +0200)
This was added to switch between input mode and normal mode, depending on the
clicked element. But the mode switching is done mainly by observing DOM
focus/blur events. So this duplicate logic become obsolete.

src/main.c

index 7f7168a..5b2d701 100644 (file)
@@ -1330,22 +1330,6 @@ static gboolean button_relase_cb(WebKitWebView *webview, GdkEventButton *event)
         vb_load_uri(&a);
 
         nopropagate = true;
-    } else if (vb.mode->id != 'p') {
-        /* don't switch back to input mode if we are currently in pass through
-         * mode when the user clicks into a form field */
-        if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE
-            || dom_is_editable(dom_get_active_element(vb.gui.webview))
-        ) {
-            /* If click to editable elemen or if the focus is on an editable
-             * element after a click - switch to insert mode. The later is
-             * used for WYSIWYG editors where the click runs into a div and
-             * not the editable element itself. */
-            vb_enter('i');
-        } else if (vb.mode->id == 'i' || vb.mode->id == 'c') {
-            /* make sure we leave insert mode or command/hint mode if the user
-             * click on a none editable element */
-            vb_enter('n');
-        }
     }
     g_object_unref(result);