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>
This commit is contained in:
Daniel Silverstone 2020-02-22 11:41:15 +00:00
parent d25fada8cf
commit f3bdee255d
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
3 changed files with 7 additions and 1 deletions

View File

@ -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,

View File

@ -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 */

View File

@ -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;
/**