Browser: Support requesting location focus

In the creation of a browser window it may be valuable to request
that the GUI focus the location input box.  This can be used when
the user requests a new tab/window to allow the entry box to be
focussed properly immediately.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-02-22 15:10:51 +00:00
parent 5c377cd285
commit 0fa5f81a52
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
3 changed files with 6 additions and 0 deletions

View File

@ -3044,6 +3044,8 @@ browser_window_create(enum browser_window_create_flags flags,
gw_flags |= GW_CREATE_CLONE;
if (flags & BW_CREATE_FOREGROUND)
gw_flags |= GW_CREATE_FOREGROUND;
if (flags & BW_CREATE_FOCUS_LOCATION)
gw_flags |= GW_CREATE_FOCUS_LOCATION;
ret->window = guit->window->create(ret,
(existing != NULL) ? existing->window : NULL,

View File

@ -112,6 +112,9 @@ enum browser_window_create_flags {
/** Request foreground opening. */
BW_CREATE_FOREGROUND = (1 << 4),
/** Request location bar focus. */
BW_CREATE_FOCUS_LOCATION = (1 << 5),
};
/** flags to browser_window_navigate */

View File

@ -68,6 +68,7 @@ typedef enum {
GW_CREATE_CLONE = (1 << 0), /**< Clone existing window */
GW_CREATE_TAB = (1 << 1), /**< Create tab in same window as existing */
GW_CREATE_FOREGROUND = (1 << 2), /**< Request this window/tab is foregrounded */
GW_CREATE_FOCUS_LOCATION = (1 << 3) , /** Request this window/tab focusses the URL input */
} gui_window_create_flags;
/**