Fixed window closing bug #43
authorMarijn van Vliet <marijn.vanvliet@med.kuleuven.be>
Sun, 18 Apr 2010 10:56:53 +0000 (10:56 +0000)
committerMarijn van Vliet <marijn.vanvliet@med.kuleuven.be>
Sun, 18 Apr 2010 10:56:53 +0000 (10:56 +0000)
git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@236 ddfedd41-794f-dd11-ae45-00112f111e67

libchimara/pager.c
libchimara/stream.c
libchimara/window.c

index d6855420dd02288022ae9bf9808d4536b5b4697a..e00daf97710c8f25e5ea4409e58618d3bd864291 100644 (file)
@@ -30,8 +30,8 @@ move_pager_and_get_scroll_distance(GtkTextView *textview, gint *view_height, gin
        gtk_text_view_get_iter_location(textview, &newpager, &pagerpos);
        gtk_text_view_get_iter_location(textview, &end, &endpos);
 
-       g_printerr("View height = %d\n", visiblerect.height);
-       g_printerr("End - Pager = %d\n", endpos.y - pagerpos.y);
+       /*g_printerr("View height = %d\n", visiblerect.height);
+       g_printerr("End - Pager = %d\n", endpos.y - pagerpos.y);*/
        
        *view_height = visiblerect.height;
        *scroll_distance = endpos.y - pagerpos.y;
index afc55be96eb4f0a7b95fffa3283fe63931cb0975..b0e97f9ff5b3553153cf72cd68e0073b84b8057f 100644 (file)
@@ -24,7 +24,7 @@ stream_new_common(glui32 rock)
        /* Add it to the global stream list */
        glk_data->stream_list = g_list_prepend(glk_data->stream_list, str);
        str->stream_list = glk_data->stream_list;
-       
+
        return str;
 }
 
index 6c635393303bcf2a49a8ffe9f71f3201011b2f3f..15f8f4b1337059e2d4452a1c338ca019a0f5c8a4 100644 (file)
@@ -26,7 +26,7 @@ window_new_common(glui32 rock)
        win->window_stream->type = STREAM_TYPE_WINDOW;
        win->window_stream->window = win;
        win->window_stream->style = "normal";
-       
+
        win->echo_stream = NULL;
        win->input_request_type = INPUT_REQUEST_NONE;
        win->line_input_buffer = NULL;
@@ -826,7 +826,12 @@ glk_window_close(winid_t win, stream_result_t *result)
        if(pair_node != NULL)
        {
                gboolean new_child_on_left = ( pair_node == g_node_first_sibling(pair_node) );
-               GNode *sibling_node = pair_node->children; /* only one child left */
+
+               /* Lookup our sibling */
+               GNode *sibling_node = pair_node->children;
+               if(sibling_node == win->window_node)
+                       sibling_node = sibling_node->next;
+
                GNode *new_parent_node = pair_node->parent;
                g_node_unlink(pair_node);
                g_node_unlink(sibling_node);
@@ -844,6 +849,7 @@ glk_window_close(winid_t win, stream_result_t *result)
                                g_node_append(new_parent_node, sibling_node);
                }
 
+               stream_close_common( ((winid_t) pair_node->data)->window_stream, NULL );
                window_close_common( (winid_t) pair_node->data, TRUE);
        } 
        else /* it was the root window */