Revision: 5742 http://geany.svn.sourceforge.net/geany/?rev=5742&view=rev Author: colombanw Date: 2011-04-26 16:21:47 +0000 (Tue, 26 Apr 2011)
Log Message: ----------- Avoid changing the tag tree if it's not the one of the current document
Modified Paths: -------------- trunk/ChangeLog trunk/src/callbacks.c trunk/src/document.c trunk/src/documentprivate.h trunk/src/sidebar.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-04-26 15:07:25 UTC (rev 5741) +++ trunk/ChangeLog 2011-04-26 16:21:47 UTC (rev 5742) @@ -18,6 +18,11 @@ src/documentprivate.h, src/editor.c, src/sidebar.c: Make sure to update the tag list only for the current document, avoiding idle updates to show the tag list for the wrong document. + * src/callbacks.c, src/document.c, src/documentprivate.h, + src/sidebar.c: + Avoid changing the tag tree if it's not the one of the current + document, fixing showing the wrong tag list when reloading + configuration files.
2011-04-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2011-04-26 15:07:25 UTC (rev 5741) +++ trunk/src/callbacks.c 2011-04-26 16:21:47 UTC (rev 5742) @@ -709,8 +709,6 @@ ui_update_popup_reundo_items(doc); ui_document_show_hide(doc); /* update the document menu */ build_menu_update(doc); - if (doc->priv->tag_list_update_needed) - document_update_tag_list_in_idle(doc); sidebar_update_tag_list(doc, FALSE);
/* We delay the check to avoid weird fast, unintended switching of notebook pages when
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2011-04-26 15:07:25 UTC (rev 5741) +++ trunk/src/document.c 2011-04-26 16:21:47 UTC (rev 5742) @@ -396,7 +396,6 @@ priv->redo_actions = NULL; priv->line_count = 0; priv->tag_list_update_source = 0; - priv->tag_list_update_needed = FALSE; #if ! defined(USE_GIO_FILEMON) priv->last_check = time(NULL); #endif @@ -2334,12 +2333,7 @@ return FALSE;
if (! main_status.quitting) - { - if (doc == document_get_current ()) - document_update_tag_list(doc, TRUE); - else - doc->priv->tag_list_update_needed = TRUE; - } + document_update_tag_list(doc, TRUE);
doc->priv->tag_list_update_source = 0; return FALSE;
Modified: trunk/src/documentprivate.h =================================================================== --- trunk/src/documentprivate.h 2011-04-26 15:07:25 UTC (rev 5741) +++ trunk/src/documentprivate.h 2011-04-26 16:21:47 UTC (rev 5742) @@ -86,8 +86,6 @@ time_t mtime; /* ID of the idle callback updating the tag list */ guint tag_list_update_source; - /* whether there is a tag list update we haven't had a chance to honor yet */ - gboolean tag_list_update_needed; } GeanyDocumentPrivate;
Modified: trunk/src/sidebar.c =================================================================== --- trunk/src/sidebar.c 2011-04-26 15:07:25 UTC (rev 5741) +++ trunk/src/sidebar.c 2011-04-26 16:21:47 UTC (rev 5742) @@ -195,7 +195,10 @@ /* changes the tree view to the given one, trying not to do useless changes */ #define CHANGE_TREE(new_child) \ G_STMT_START { \ - if (child != new_child) \ + /* only change the tag tree if it's actually not the same (to avoid flickering) and if + * it's the one of the current document (to avoid problems when e.g. reloading + * configuration files */ \ + if (child != new_child && doc == document_get_current()) \ { \ if (child) \ gtk_container_remove(GTK_CONTAINER(tag_window), child); \ @@ -213,8 +216,6 @@ return; }
- doc->priv->tag_list_update_needed = FALSE; - if (update) { /* updating the tag list in the left tag window */ if (doc->priv->tag_tree == NULL)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.