summaryrefslogtreecommitdiff
path: root/gtk/window.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-07-25 16:29:18 +0100
committerVincent Sanders <vince@kyllikki.org>2014-07-27 18:07:00 +0100
commit06a1d75d52dc533474194c0c9b33eecf09b59068 (patch)
treeec124b7110b54489826b46b02decb1d1735f3014 /gtk/window.c
parent984299e5b4feda4ffb6fd80f0d1f489c32e6d512 (diff)
downloadnetsurf-06a1d75d52dc533474194c0c9b33eecf09b59068.tar.gz
netsurf-06a1d75d52dc533474194c0c9b33eecf09b59068.tar.bz2
stop gtk about dialog forcing navigation of existing browsing contexts
Diffstat (limited to 'gtk/window.c')
-rw-r--r--gtk/window.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/gtk/window.c b/gtk/window.c
index dc8cbf935..8ce8ebe8d 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -696,13 +696,26 @@ static void window_destroy(GtkWidget *widget, gpointer data)
g_object_unref(gw->input_method);
}
-/* Core interface documented in desktop/gui.h to create a gui_window */
+
+/**
+ * Create and open a gtk container (window or tab) for a browsing context.
+ *
+ * \param bw The browsing context to create gui_window for.
+ * \param existing An existing gui_window, may be NULL
+ * \param flags flags to control the container creation
+ * \return gui window, or NULL on error
+ *
+ * If GW_CREATE_CLONE flag is set existing is non-NULL.
+ *
+ * Front end's gui_window must include a reference to the
+ * browser window passed in the bw param.
+ */
static struct gui_window *
gui_window_create(struct browser_window *bw,
struct gui_window *existing,
gui_window_create_flags flags)
{
- struct gui_window *g; /**< what we're creating to return */
+ struct gui_window *g; /* what is being creating to return */
GError* error = NULL;
bool tempback;
GtkBuilder* xml;
@@ -732,8 +745,11 @@ gui_window_create(struct browser_window *bw,
/* attach scaffold */
if (flags & GW_CREATE_TAB) {
- assert(existing != NULL);
- g->scaffold = existing->scaffold;
+ if (existing != NULL) {
+ g->scaffold = existing->scaffold;
+ } else {
+ g->scaffold = nsgtk_current_scaffolding();
+ }
} else {
/* Now construct and attach a scaffold */
g->scaffold = nsgtk_new_scaffolding(g);