summaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-17 02:56:21 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-17 02:56:21 (EDT)
commitf27afc611a387caf8c5774b4c167f2b9295e5be2 (patch)
treef0f27148da4c388eacab64f5cedca183e063f6af /src/window.c
parenta51634aa54dd1845460e8e96f22f6cbf63e7cefb (diff)
downloadmarquee-f27afc611a387caf8c5774b4c167f2b9295e5be2.zip
marquee-f27afc611a387caf8c5774b4c167f2b9295e5be2.tar.gz
marquee-f27afc611a387caf8c5774b4c167f2b9295e5be2.tar.bz2
src/window.c: Add a stub function to update tab positions
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c15
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) {