textview: Reset bubble source id once run
authorMohammed Sadiq <sadiq@sadiqpk.org>
Fri, 11 May 2018 04:10:48 +0000 (09:40 +0530)
committerMohammed Sadiq <sadiq@sadiqpk.org>
Fri, 11 May 2018 10:39:50 +0000 (16:09 +0530)
The bubble_timeout_id was reset only on some special case.
And so warnings were shown when the source is being tried
to be removed with the already removed id.

Fix this by unconditionally resetting the id on start of the function.

gtk/gtktextview.c

index 84b054622fe505a32df4930c87a7123beaa83b86..3bdaf4c04d50222e59ea4fc3610811927bf84179 100644 (file)
@@ -8781,6 +8781,7 @@ gtk_text_view_selection_bubble_popup_show (gpointer user_data)
   GtkWidget *box;
   GtkWidget *toolbar;
 
+  priv->selection_bubble_timeout_id = 0;
   has_selection = gtk_text_buffer_get_selection_bounds (get_buffer (text_view),
                                                         &sel_start, &sel_end);
   gtk_text_buffer_get_bounds (get_buffer (text_view), &start, &end);
@@ -8789,10 +8790,7 @@ gtk_text_view_selection_bubble_popup_show (gpointer user_data)
                  gtk_text_iter_equal (&end, &sel_end);
 
   if (!priv->editable && !has_selection)
-    {
-      priv->selection_bubble_timeout_id = 0;
-      return G_SOURCE_REMOVE;
-    }
+    return G_SOURCE_REMOVE;
 
   if (priv->selection_bubble)
     gtk_widget_destroy (priv->selection_bubble);