]> spindle.queued.net Git - midori/commitdiff
Only middle click search if the selection contains :// or Alt
authorChristian Dywan <christian@twotoasts.de>
Tue, 2 Mar 2010 23:31:35 +0000 (00:31 +0100)
committerChristian Dywan <christian@twotoasts.de>
Tue, 2 Mar 2010 23:31:35 +0000 (00:31 +0100)
Accidentally searching is annoying. Presumably when a proper
address is selected it was intentional.

midori/midori-view.c

index 3bd811ea5634457c3ca43b7b31b7e6d6bc0b7077..917ccb3afe3cdb4ffdf3ee8b2815d3cce63c156f 100644 (file)
@@ -1324,6 +1324,11 @@ gtk_widget_button_press_event_cb (WebKitWebView*  web_view,
                     }
                     katze_assign (uri, new_uri);
                 }
+                else if (!strstr (uri, "://"))
+                {
+                    g_free (uri);
+                    return FALSE;
+                }
 
                 if (MIDORI_MOD_NEW_TAB (event->state))
                 {
@@ -1337,8 +1342,8 @@ gtk_widget_button_press_event_cb (WebKitWebView*  web_view,
                     midori_view_set_uri (MIDORI_VIEW (view), uri);
                     gtk_widget_grab_focus (GTK_WIDGET (view));
                 }
+                g_free (uri);
                 return TRUE;
-            g_free (uri);
             }
         }
         break;