[gimp] app: don't invalidate viewable preview when thawed unless explicitly requested



commit 9dabad4cb9d1cfc14cd07a6ac7c739033acdc622
Author: Ell <ell_se yahoo com>
Date:   Fri Mar 29 04:47:24 2019 -0400

    app: don't invalidate viewable preview when thawed unless explicitly requested
    
    In GimpViewable, don't invalidate the preview when thawed, unless
    there was an explicit call to gimp_viewable_invalidate_preview()
    while it was frozen.  This avoids invalidating the previews of an
    invisible drawable's ancestors when the drawable's preview is
    frozen/thawed.

 app/core/gimpviewable.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/app/core/gimpviewable.c b/app/core/gimpviewable.c
index 75d03ffab3..42f79d46e8 100644
--- a/app/core/gimpviewable.c
+++ b/app/core/gimpviewable.c
@@ -66,6 +66,7 @@ struct _GimpViewablePrivate
   gchar        *icon_name;
   GdkPixbuf    *icon_pixbuf;
   gint          freeze_count;
+  gboolean      invalidate_pending;
   GimpViewable *parent;
   gint          depth;
 
@@ -586,6 +587,8 @@ gimp_viewable_invalidate_preview (GimpViewable *viewable)
 
   if (private->freeze_count == 0)
     g_signal_emit (viewable, viewable_signals[INVALIDATE_PREVIEW], 0);
+  else
+    private->invalidate_pending = TRUE;
 }
 
 /**
@@ -1303,7 +1306,12 @@ gimp_viewable_preview_thaw (GimpViewable *viewable)
 
   if (private->freeze_count == 0)
     {
-      gimp_viewable_invalidate_preview (viewable);
+      if (private->invalidate_pending)
+        {
+          private->invalidate_pending = FALSE;
+
+          gimp_viewable_invalidate_preview (viewable);
+        }
 
       g_object_notify (G_OBJECT (viewable), "frozen");
 


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