[Xfce4-commits] <midori:master> Find links opens tabs with Control and Shift respectively

Christian Dywan noreply at xfce.org
Tue Oct 26 23:04:04 CEST 2010


Updating branch refs/heads/master
         to 95f22785425f709a414040deb2f6dc8ab8489fdf (commit)
       from ad6905db4d1ccec5a73da7fa9c01180be4b3950a (commit)

commit 95f22785425f709a414040deb2f6dc8ab8489fdf
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Oct 26 22:57:34 2010 +0200

    Find links opens tabs with Control and Shift respectively

 midori/midori-view.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 10efb34..2e6f462 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1799,6 +1799,8 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
     guint character;
     gint digit = g_ascii_digit_value (event->keyval);
 
+    event->state = event->state & MIDORI_KEYS_MODIFIER_MASK;
+
     /* Find links by number: . to show links, type number, Return to go */
     if (event->keyval == '.'
      || (view->find_links > -1 && (digit != -1 || event->keyval == GDK_Return)))
@@ -1844,9 +1846,22 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
                 "if (return_key || typeof links[i * 10] == 'undefined') {"
                 "    for (var j = 0; j < links.length; j++)"
                 "        links[j].style.display = 'none !important';"
-                "    location.href = links[i].parentNode.href; }",
+                "    links[i].parentNode.href; }",
                 view->find_links, event->keyval == GDK_Return);
             result = sokoke_js_script_eval (js_context, script, NULL);
+            if (strcmp (result, "undefined"))
+            {
+                view->find_links = -1;
+                if (MIDORI_MOD_NEW_TAB (event->state))
+                {
+                    gboolean background = view->open_tabs_in_the_background;
+                    if (MIDORI_MOD_BACKGROUND (event->state))
+                        background = !background;
+                    g_signal_emit (view, signals[NEW_TAB], 0, result, background);
+                }
+                else
+                    midori_view_set_uri (view, result);
+            }
             g_free (script);
         }
         else



More information about the Xfce4-commits mailing list