summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-22 15:10:51 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-22 15:10:51 +0000
commit0fa5f81a52a62a04f4564d84e391543995cf9418 (patch)
treefb78494544c63efe122f904e586a14906371f02f
parent5c377cd285536f4bec2a6cfb6352a45cfe6cb39e (diff)
downloadnetsurf-0fa5f81a52a62a04f4564d84e391543995cf9418.tar.gz
netsurf-0fa5f81a52a62a04f4564d84e391543995cf9418.tar.bz2
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>
-rw-r--r--desktop/browser_window.c2
-rw-r--r--include/netsurf/browser_window.h3
-rw-r--r--include/netsurf/window.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index fcee08599..2a3948f4c 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -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,
diff --git a/include/netsurf/browser_window.h b/include/netsurf/browser_window.h
index 75977ace4..f8b86d07a 100644
--- a/include/netsurf/browser_window.h
+++ b/include/netsurf/browser_window.h
@@ -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 */
diff --git a/include/netsurf/window.h b/include/netsurf/window.h
index a393a3560..16fd95e30 100644
--- a/include/netsurf/window.h
+++ b/include/netsurf/window.h
@@ -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;
/**