X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fwindow.c;h=ea490c93db88d7a2e484a45a8c2b6a0adbce819a;hb=2e7aa380dbd9660314df829820d3a7bf73b7d4d0;hp=49936677c23dfca5f5a001507106aa7e73d548ee;hpb=fed235e548376a8a2763405c4623fdf23f5c6529;p=rodin%2Fchimara.git diff --git a/src/window.c b/src/window.c index 4993667..ea490c9 100644 --- a/src/window.c +++ b/src/window.c @@ -480,10 +480,13 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype, /* Insert the new window into the window tree */ if(split->window_node->parent == NULL) - { glk_data->root_window = pair->window_node; - } else { - g_node_append(split->window_node->parent, pair->window_node); + else + { + if( split->window_node == g_node_first_sibling(split->window_node) ) + g_node_prepend(split->window_node->parent, pair->window_node); + else + g_node_append(split->window_node->parent, pair->window_node); g_node_unlink(split->window_node); } /* Place the windows in the correct order */