summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Riemann <friemann@gnome.org>2020-07-04 15:15:50 +0200
committerFelix Riemann <friemann@gnome.org>2020-07-04 15:39:13 +0200
commit368cf977646a503dc1c993ae20fe75e6f0437a8c (patch)
tree030e83ffb6d59c18cf39f438bf741f1efe08d333
parent194c8f496111d5e89dbeb8f02b601c4dddfda37b (diff)
downloadeog-368cf977646a503dc1c993ae20fe75e6f0437a8c.tar.gz
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.
-rw-r--r--src/eog-thumb-view.c4
1 files changed, 3 insertions, 1 deletions
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);
}
}