[gtksourceview] assistant: gtk_widget_queue_resize() when updating position



commit 56d831f3613ab7ef8e7ecebe95c470c0687a0b53
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 2 14:45:19 2022 -0700

    assistant: gtk_widget_queue_resize() when updating position
    
    When we update our position from the next frame cycle, we need to also
    ensure that we measure/size_allocate for the updated popover. Otherwise we
    risk having warnings about allocations not being up to date.
    
    This fixes a bunch of flickering in the source view while using completion
    popovers which rapidly update.

 gtksourceview/gtksourceassistant.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/gtksourceview/gtksourceassistant.c b/gtksourceview/gtksourceassistant.c
index a431756a..ff954926 100644
--- a/gtksourceview/gtksourceassistant.c
+++ b/gtksourceview/gtksourceassistant.c
@@ -195,6 +195,13 @@ gtk_source_assistant_reposition_tick_cb (GtkWidget     *widget,
 
        _gtk_source_assistant_update_position (self);
 
+       /* We have to gtk_widget_queue_resize() to ensure that the view will
+        * continue to have an allocation when the assistant gets snapshotted.
+        * gtk_widget_queue_allocate() is not enough to make that happen.
+        * Without this, we often get flickering of the GtkSourceView.
+        */
+       gtk_widget_queue_resize (widget);
+
        return G_SOURCE_REMOVE;
 }
 


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