From 5239163f4dd47a3f9ca74501575053a69c5a95b8 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 22 Feb 2020 15:12:22 +0000 Subject: GTK: Request and honour location focus So that when we create a new tab we automatically focus the location box, pass the flag into create, and honour it when it comes back to us. Signed-off-by: Daniel Silverstone --- frontends/gtk/window.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'frontends/gtk/window.c') diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c index b47a1b07d..64f09ebbf 100644 --- a/frontends/gtk/window.c +++ b/frontends/gtk/window.c @@ -969,6 +969,13 @@ gui_window_create(struct browser_window *bw, */ g_object_unref(tab_builder); + /* Finally we need to focus the location bar if requested */ + if (flags & GW_CREATE_FOCUS_LOCATION) { + if (nsgtk_window_item_activate(g, OPENLOCATION_BUTTON) != NSERROR_OK) { + NSLOG(netsurf, WARNING, "Unable to focus location input"); + } + } + return g; } -- cgit v1.2.3