[epiphany/gnome-3-34] automation: focus the web view after creating it for automation



commit 4cee36b371a8ce11a986fc68d881c3ca27502316
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Thu Oct 3 14:25:48 2019 +0200

    automation: focus the web view after creating it for automation
    
    The focus is currently in the location entry because loads are not
    triggered by ephy.

 src/ephy-shell.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index f62d62566..25157f975 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -431,10 +431,13 @@ create_web_view_for_automation_cb (WebKitAutomationSession *session,
   embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
   n_embeds = ephy_embed_container_get_n_children (EPHY_EMBED_CONTAINER (window));
   web_view = ephy_embed_get_web_view (embed);
-  if (n_embeds == 1 && ephy_web_view_get_visit_type (web_view) == EPHY_PAGE_VISIT_HOMEPAGE)
+  if (n_embeds == 1 && ephy_web_view_get_visit_type (web_view) == EPHY_PAGE_VISIT_HOMEPAGE) {
+    gtk_widget_grab_focus (GTK_WIDGET (embed));
     return GTK_WIDGET (web_view);
+  }
 
   embed = ephy_shell_new_tab (shell, window, NULL, EPHY_NEW_TAB_JUMP);
+  gtk_widget_grab_focus (GTK_WIDGET (embed));
   return GTK_WIDGET (ephy_embed_get_web_view (embed));
 }
 


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