From c6ac335990389ebbc8a67629ebe3b6ca6bf921a3 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 22 Sep 2017 16:39:08 -0400 Subject: Save MqApplication in MqTab --- diff --git a/src/tab.c b/src/tab.c index 2bb9cac..79308c1 100644 --- a/src/tab.c +++ b/src/tab.c @@ -200,11 +200,12 @@ title_cb(WebKitWebView __attribute__((unused)) *web_view, } MqTab * -mq_tab_new(gchar *uri) +mq_tab_new(MqApplication *application, gchar *uri) { MqTab *tab; tab = malloc(sizeof(*tab)); + tab->application = application; mq_tab_populate_tab(tab); diff --git a/src/tab.h b/src/tab.h index 3361acc..813f3fb 100644 --- a/src/tab.h +++ b/src/tab.h @@ -24,10 +24,12 @@ #include +#include "application.h" #include "tab-chrome.h" #include "tab-body.h" typedef struct { + MqApplication *application; GtkWidget *container; MqTabChrome *chrome; MqTabBody *body; @@ -41,7 +43,7 @@ typedef struct { } MqTab; MqTab * -mq_tab_new(gchar *uri); +mq_tab_new(MqApplication *application, gchar *uri); GtkWidget * mq_tab_get_tab(MqTab *tab); diff --git a/src/window.c b/src/window.c index 8f0d5c6..3c05330 100644 --- a/src/window.c +++ b/src/window.c @@ -28,12 +28,12 @@ #include "tab.h" static void -add_tab(MqWindow *window, gchar *uri, gint position) +add_tab(MqApplication *application, MqWindow *window, gchar *uri, gint position) { MqTab *tab; GtkWidget *tab_widget; - tab = mq_tab_new(uri); + tab = mq_tab_new(application, uri); tab_widget = mq_tab_get_container(tab); position = gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook), @@ -83,10 +83,10 @@ mq_window_new(MqApplication *application, gchar **uris) if (uris && uris[0]) { for (i = 0; uris && uris[i]; ++i) { - add_tab(window, uris[i], -1); + add_tab(application, window, uris[i], -1); } } else { - add_tab(window, NULL, -1); + add_tab(application, window, NULL, -1); } gtk_widget_show_all(window->window); -- cgit v0.9.1