From 9662e99354bc3ef147f60fa48e3f40f177d92597 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 22 Feb 2009 16:12:58 +0100 Subject: [PATCH] Do not actually search less than 3 characters in 'typing' search --- midori/midori-browser.c | 8 ++++++-- midori/midori-view.c | 4 +--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 2ce320c7..8484a80c 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -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 diff --git a/midori/midori-view.c b/midori/midori-view.c index 634c9be8..928e39e8 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -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); } -- 2.39.5