From 17bb4d51e0d17ebf632a02bff5ef0e12dbc5c69b Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 24 Sep 2017 23:25:35 -0400 Subject: mq_tab_new(), mq_tab_new_relative(): Change argument type to (MqWindow *) And save the window in the MqTab struct. --- (limited to 'src') diff --git a/src/tab.c b/src/tab.c index 913b34f..2998c2f 100644 --- a/src/tab.c +++ b/src/tab.c @@ -113,7 +113,7 @@ reload_tab_clicked_cb(GtkWidget __attribute__((unused)) *button, MqTab *tab) static void new_tab_clicked_cb(GtkWidget __attribute__((unused)) *button, MqTab *tab) { - mq_tab_new(tab->application, NULL, tab); + mq_tab_new(tab->window, NULL, tab); gtk_widget_hide(tab->popover); } @@ -296,7 +296,7 @@ title_cb(WebKitWebView __attribute__((unused)) *web_view, } static MqTab * -init_non_root(MqApplication *application, gchar *uri) +init_non_root(MqWindow *window, gchar *uri) { MqTab *tab; @@ -306,7 +306,8 @@ init_non_root(MqApplication *application, gchar *uri) tab->next = NULL; tab->first_child = tab->last_child = NULL; tab->tree_size = 1; - tab->application = application; + tab->window = window; + tab->application = mq_window_get_application(window); mq_tab_populate_tab(tab); @@ -329,11 +330,11 @@ init_non_root(MqApplication *application, gchar *uri) } MqTab * -mq_tab_new(MqApplication *application, gchar *uri, MqTab *source) +mq_tab_new(MqWindow *window, gchar *uri, MqTab *source) { MqTab *tab; - tab = init_non_root(application, uri); + tab = init_non_root(window, uri); append_sibling(tab, source); @@ -341,11 +342,11 @@ mq_tab_new(MqApplication *application, gchar *uri, MqTab *source) } MqTab * -mq_tab_new_relative(MqApplication *application, gchar *uri, MqTab *source) +mq_tab_new_relative(MqWindow *window, gchar *uri, MqTab *source) { MqTab *tab; - tab = init_non_root(application, uri); + tab = init_non_root(window, uri); append_child(tab, source); diff --git a/src/tab.h b/src/tab.h index 6316b02..d6ce5d9 100644 --- a/src/tab.h +++ b/src/tab.h @@ -27,6 +27,7 @@ typedef struct MqTab MqTab; #include #include "application.h" +#include "window.h" #include "tab-chrome.h" #include "tab-body.h" @@ -39,6 +40,7 @@ struct MqTab { guint position; guint tree_size; MqApplication *application; + MqWindow *window; GtkWidget *container; MqTabChrome *chrome; MqTabBody *body; @@ -52,10 +54,10 @@ struct MqTab { }; MqTab * -mq_tab_new(MqApplication *application, gchar *uri, MqTab *source); +mq_tab_new(MqWindow *window, gchar *uri, MqTab *source); MqTab * -mq_tab_new_relative(MqApplication *application, gchar *uri, MqTab *source); +mq_tab_new_relative(MqWindow *window, gchar *uri, MqTab *source); MqTab * mq_tab_new_root(void); diff --git a/src/window.c b/src/window.c index 5e246c6..4a4c9d8 100644 --- a/src/window.c +++ b/src/window.c @@ -33,7 +33,7 @@ add_tab(MqApplication *application, MqWindow *window, gchar *uri, gint position) MqTab *tab; GtkWidget *tab_widget; - tab = mq_tab_new_relative(application, uri, window->root_tab); + tab = mq_tab_new_relative(window, uri, window->root_tab); tab_widget = mq_tab_get_container(tab); position = gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook), -- cgit v0.9.1