summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-22 11:41:15 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-22 11:41:15 +0000
commitf3bdee255d3c4252640b2337224e2f0b95944d7f (patch)
tree1030c437adfeef4b0451bea43a7f1a76570e0d48
parentd25fada8cf820b8748a822b510b18f34f8a6ed30 (diff)
downloadnetsurf-f3bdee255d3c4252640b2337224e2f0b95944d7f.tar.gz
netsurf-f3bdee255d3c4252640b2337224e2f0b95944d7f.tar.bz2
Browser: Add FOREGROUND flag to window creation
To better support new-tab / new-window operations as well as GUIs which want to allow tabs to open in the background by default, add a flag to request a new browser window be foregrounded. This will allow us to simplify at least the GTK frontend a little. 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.h3
3 files changed, 7 insertions, 1 deletions
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index dea507fef..fcee08599 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -3042,6 +3042,8 @@ browser_window_create(enum browser_window_create_flags flags,
gw_flags |= GW_CREATE_TAB;
if (flags & BW_CREATE_CLONE)
gw_flags |= GW_CREATE_CLONE;
+ if (flags & BW_CREATE_FOREGROUND)
+ gw_flags |= GW_CREATE_FOREGROUND;
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 98139aa02..75977ace4 100644
--- a/include/netsurf/browser_window.h
+++ b/include/netsurf/browser_window.h
@@ -109,6 +109,9 @@ enum browser_window_create_flags {
* have that option.
*/
BW_CREATE_UNVERIFIABLE = (1 << 3),
+
+ /** Request foreground opening. */
+ BW_CREATE_FOREGROUND = (1 << 4),
};
/** flags to browser_window_navigate */
diff --git a/include/netsurf/window.h b/include/netsurf/window.h
index 8f14a8c78..a393a3560 100644
--- a/include/netsurf/window.h
+++ b/include/netsurf/window.h
@@ -66,7 +66,8 @@ typedef enum {
typedef enum {
GW_CREATE_NONE = 0, /**< New window */
GW_CREATE_CLONE = (1 << 0), /**< Clone existing window */
- GW_CREATE_TAB = (1 << 1) /**< Create tab in same window as existing */
+ GW_CREATE_TAB = (1 << 1), /**< Create tab in same window as existing */
+ GW_CREATE_FOREGROUND = (1 << 2), /**< Request this window/tab is foregrounded */
} gui_window_create_flags;
/**