]> spindle.queued.net Git - midori/commitdiff
Do not actually search less than 3 characters in 'typing' search
authorChristian Dywan <christian@twotoasts.de>
Sun, 22 Feb 2009 15:12:58 +0000 (16:12 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sun, 22 Feb 2009 15:12:58 +0000 (16:12 +0100)
midori/midori-browser.c
midori/midori-view.c

index 2ce320c70ddc41a213e2f3b187e940a5fc745af3..8484a80c16ab0906a42425c0e2cac17fb0006177 100644 (file)
@@ -893,7 +893,7 @@ midori_view_search_text_cb (GtkWidget*     view,
         gtk_editable_insert_text (GTK_EDITABLE (browser->find_text), typing, -1, &position);
         gtk_editable_set_position (GTK_EDITABLE (browser->find_text), -1);
     }
-    if (GTK_WIDGET_VISIBLE (browser->find))
+    if (GTK_WIDGET_VISIBLE (browser->find) && !typing)
     {
         gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (browser->find_text),
             GTK_ICON_ENTRY_PRIMARY, (found) ? GTK_STOCK_FIND : GTK_STOCK_STOP);
@@ -1578,7 +1578,11 @@ midori_browser_find_text_changed_cb (GtkWidget*     entry,
                                      MidoriBrowser* browser)
 {
     if (browser->find_typing)
-        _midori_browser_find (browser, TRUE);
+    {
+        const gchar* text = gtk_entry_get_text (GTK_ENTRY (entry));
+        if (g_utf8_strlen (text, -1) > 2)
+            _midori_browser_find (browser, TRUE);
+    }
 }
 
 static gboolean
index 634c9be86424b68c791e063654314d4ef728dd8d..928e39e874df29065c3d284ef0b06de187ee260d 100644 (file)
@@ -822,9 +822,7 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
     {
         gchar* text = g_strdup_printf ("%c", character);
 
-        g_signal_emit (view, signals[SEARCH_TEXT], 0,
-        webkit_web_view_search_text (web_view,
-            text, FALSE, TRUE, TRUE), text);
+        g_signal_emit (view, signals[SEARCH_TEXT], 0, TRUE, text);
         g_free (text);
     }