[epiphany/gnome-3-28] Don't search on ' or /



commit 6222dfbb5d9175f3087202b2d0fd45b150654c9f
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Mon Apr 9 10:32:34 2018 -0500

    Don't search on ' or /
    
    This causes problems in practice on certain websites (e.g. Facebook,
    Riot) where the key press is handled by both the web page and the
    browser. I'm guessing these sites are not using normal text entries.
    Anyway, these are really niche shortcuts when the much more common
    Ctrl+F is available, which does not have any web compat implications.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795083

 embed/ephy-find-toolbar.c |   30 ------------------------------
 src/ephy-window.c         |    2 +-
 2 files changed, 1 insertions(+), 31 deletions(-)
---
diff --git a/embed/ephy-find-toolbar.c b/embed/ephy-find-toolbar.c
index a9a03d3..9b3ebb7 100644
--- a/embed/ephy-find-toolbar.c
+++ b/embed/ephy-find-toolbar.c
@@ -134,32 +134,6 @@ clear_status (EphyFindToolbar *toolbar)
   webkit_find_controller_search_finish (toolbar->controller);
 }
 
-/* Code adapted from gtktreeview.c:gtk_tree_view_key_press() and
- * gtk_tree_view_real_start_interactive_seach()
- */
-static gboolean
-tab_search_key_press_cb (WebKitWebView   *web_view,
-                         GdkEventKey     *event,
-                         EphyFindToolbar *toolbar)
-{
-  GtkWidget *widget = (GtkWidget *)toolbar;
-
-  g_assert (event != NULL);
-
-  /* check for / and ' which open the find toolbar in text resp. link mode */
-  if (gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (widget)) == FALSE) {
-    if (event->keyval == GDK_KEY_slash) {
-      ephy_find_toolbar_open (toolbar, FALSE, TRUE);
-      return TRUE;
-    } else if (event->keyval == GDK_KEY_apostrophe) {
-      ephy_find_toolbar_open (toolbar, TRUE, TRUE);
-      return TRUE;
-    }
-  }
-
-  return FALSE;
-}
-
 static void
 real_find (EphyFindToolbar  *toolbar,
            EphyFindDirection direction)
@@ -562,10 +536,6 @@ ephy_find_toolbar_set_web_view (EphyFindToolbar *toolbar,
                       toolbar);
 
     clear_status (toolbar);
-
-    g_signal_connect_object (EPHY_WEB_VIEW (web_view), "search-key-press",
-                             G_CALLBACK (tab_search_key_press_cb),
-                             toolbar, 0);
   }
 }
 
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 3d90f26..e7aa10f 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -93,7 +93,7 @@ const struct {
   { "win.zoom-out", { "<Primary>minus", "<Primary>KP_Subtract", "ZoomOut", NULL } },
   { "win.zoom-normal", { "<Primary>0", "<Primary>KP_0", NULL } },
   { "win.print", { "<Primary>P", NULL } },
-  { "win.find", { "<Primary>F", "Search", NULL } },
+  { "win.find", { "<Primary>F", NULL } },
   { "win.find-prev", { "<shift><Primary>G", NULL } },
   { "win.find-next", { "<Primary>G", NULL } },
   { "win.bookmark-page", { "<Primary>D", "AddFavorite", NULL } },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]