[eog/gnome-3-36] EogThumbView: Fix visible range callback being called to often



commit 368cf977646a503dc1c993ae20fe75e6f0437a8c
Author: Felix Riemann <friemann gnome org>
Date:   Sat Jul 4 15:15:50 2020 +0200

    EogThumbView: Fix visible range callback being called to often
    
    The callback that handles unloading invisible thumbnails is prepared
    to only queue the worker function once as idle source.
    However, this protection was not used correctly which could cause the
    callback queuing the worker multiple times. This could lead to unnecessary
    redraw cycles and flickering as mentioned in !42.
    
    (cherry picked from commit 69e5b8430b861982131e342acf935cfbc0709e24)
    
    See !61.

 src/eog-thumb-view.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/eog-thumb-view.c b/src/eog-thumb-view.c
index 44b16d12..6493f17e 100644
--- a/src/eog-thumb-view.c
+++ b/src/eog-thumb-view.c
@@ -337,7 +337,9 @@ static void
 eog_thumb_view_visible_range_changed (EogThumbView *thumbview)
 {
        if (thumbview->priv->visible_range_changed_id == 0) {
-               g_idle_add ((GSourceFunc)visible_range_changed_cb, thumbview);
+               thumbview->priv->visible_range_changed_id =
+                      g_idle_add ((GSourceFunc)visible_range_changed_cb,
+                                  thumbview);
        }
 }
 


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