From a4621ae605a2ccefdb8e0b2d51178f6802cd8794 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 28 Sep 2017 11:55:43 -0400 Subject: MqTab: Propagate root pointer through tree --- (limited to 'src/tab.c') diff --git a/src/tab.c b/src/tab.c index 8ba6f0c..a38f5c4 100644 --- a/src/tab.c +++ b/src/tab.c @@ -75,6 +75,7 @@ update_tree_sizes(MqTab *node, guint step) static void append_child(MqTab *new_node, MqTab *parent) { + new_node->root = parent->root; new_node->parent = parent; new_node->next = NULL; new_node->prev = parent->last_child; /* May be NULL */ @@ -95,6 +96,7 @@ append_child(MqTab *new_node, MqTab *parent) static void append_sibling(MqTab *new_node, MqTab *prev_sibling) { + new_node->root = prev_sibling->root; new_node->parent = prev_sibling->parent; new_node->prev = prev_sibling; new_node->next = prev_sibling->next; /* May be NULL */ @@ -406,6 +408,7 @@ mq_tab_new_root(MqWindow *window) MqTab *tab; tab = malloc(sizeof(*tab)); + tab->root = tab; tab->parent = NULL; tab->prev = NULL; tab->next = NULL; -- cgit v0.9.1