mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
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 <dsilvers@digital-scurf.org>
This commit is contained in:
parent
0fa5f81a52
commit
5239163f4d
@ -926,7 +926,7 @@ nsgtk_browser_window_create(struct browser_window *bw, bool intab)
|
|||||||
{
|
{
|
||||||
nserror res = NSERROR_OK;
|
nserror res = NSERROR_OK;
|
||||||
nsurl *url = NULL;
|
nsurl *url = NULL;
|
||||||
int flags = BW_CREATE_HISTORY | BW_CREATE_FOREGROUND;
|
int flags = BW_CREATE_HISTORY | BW_CREATE_FOREGROUND | BW_CREATE_FOCUS_LOCATION;
|
||||||
|
|
||||||
if (intab) {
|
if (intab) {
|
||||||
flags |= BW_CREATE_TAB;
|
flags |= BW_CREATE_TAB;
|
||||||
|
@ -969,6 +969,13 @@ gui_window_create(struct browser_window *bw,
|
|||||||
*/
|
*/
|
||||||
g_object_unref(tab_builder);
|
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;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user