diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/window.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c index ee5725a..8b6efb1 100644 --- a/src/window.c +++ b/src/window.c @@ -58,6 +58,19 @@ add_tab(MqWindow *window, gchar *uri, gint position) mq_tab_update_position(tab, position); } +static void +update_positions(GtkNotebook __attribute__((unused)) *notebook, + GtkWidget __attribute__((unused)) *child, + guint __attribute__((unused)) page_num, MqWindow *window) +{ + /* TODO: Once MqWindow has a data structure for tabs, loop through them + * all and call mq_tab_update_position(). */ + /* TODO: Should this also update the tabs data structure? Probably. */ + + /* Temporarily "use" window. */ + window = window; +} + MqWindow * mq_window_new(gchar **uris) { @@ -77,6 +90,8 @@ mq_window_new(gchar **uris) gtk_notebook_set_group_name(GTK_NOTEBOOK(window->notebook), "mq-tabs"); gtk_container_add(GTK_CONTAINER(window->window), window->notebook); + g_signal_connect(window->notebook, "page-reordered", + G_CALLBACK(update_positions), window); if (uris && uris[0]) { for (i = 0; uris && uris[i]; ++i) { |