[gtksourceview] Completion: fix a critical message



commit 522b526d58ad9aa45bc7515b55256cdd6266e5fe
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Jan 5 15:25:12 2014 +0100

    Completion: fix a critical message
    
    See the comment in the code.

 gtksourceview/gtksourcecompletion.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index e861468..4acdf5b 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -436,6 +436,18 @@ update_window_position (GtkSourceCompletion *completion)
        GtkTextIter iter;
        gboolean iter_set = FALSE;
 
+       /* The model can be modified while there is no completion context, for
+        * example when the headers are shown or hidden. This triggers a signal
+        * to update the window position, but if there is no completion context,
+        * no need to update the window position (the window is normally hidden
+        * in this case). When a new population is done, this function will be
+        * called again, so no problem.
+        */
+       if (completion->priv->context == NULL)
+       {
+               return;
+       }
+
        if (get_selected_proposal (completion, &provider, &proposal))
        {
                if (gtk_source_completion_provider_get_start_iter (provider,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]