]> git.armaanb.net Git - chorizo.git/blobdiff - src/browser.c
Don't automatically search forwards
[chorizo.git] / src / browser.c
index 50542416f3034e82c3421050b184f97e7cba013e..72104f26c78d23cf4b6f4b858032adfe24577cc1 100644 (file)
@@ -860,11 +860,12 @@ search_init(struct Client *c, int direction) {
     const gchar *contents = gtk_entry_get_text(GTK_ENTRY(c->location));
     if (strcspn(contents, "s/")) {
         gtk_entry_set_text(GTK_ENTRY(c->location), "s/");
+        gtk_editable_set_position(GTK_EDITABLE(c->location), -1);
+    } else {
+        search(c, 0);
+        search(c, -1);
+        search(c, direction);
     }
-    gtk_editable_set_position(GTK_EDITABLE(c->location), -1);
-    search(c, 0);
-    search(c, -1);
-    search(c, direction);
 }
 
 int
@@ -1121,9 +1122,12 @@ key_web_view(GtkWidget *widget, GdkEvent *event, gpointer data) {
             gtk_entry_set_progress_fraction(GTK_ENTRY(c->location), 0);
         }
     } else if (event->type == GDK_BUTTON_RELEASE) {
+        GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask();
         switch (((GdkEventButton *)event)->button) {
-        case 2:
-            if (c->hover_uri != NULL) {
+        case 1:
+            if ((((GdkEventButton *)event)->state & modifiers) ==
+                    GDK_CONTROL_MASK &&
+                c->hover_uri != NULL) {
                 client_new(c->hover_uri, NULL, TRUE, FALSE);
                 return TRUE;
             }