[gtksourceview/gnome-3-10] Completion: fix a critical message



commit 35615fb9cae1b49402c670c4304f7534dda2e79e
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 326aae9..2ef5ce0 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]