[gimp] Bug 760212 - method edit-stroke fails in version 2.9



commit db9ba0c8f66fd7a879dfbc54d51bfa7cb0c2572a
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jan 10 19:29:05 2016 +0100

    Bug 760212 - method edit-stroke fails in version 2.9
    
    Need to keep GimpPDBContext's stroke options (which is a context too)
    in sync with the PDB context itself, so setting any of the context's
    properties properly affects subsquent strokes, and also avoids running
    into inconsistent states like happened in this bug.

 app/pdb/gimppdbcontext.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/app/pdb/gimppdbcontext.c b/app/pdb/gimppdbcontext.c
index dd80391..9cb030e 100644
--- a/app/pdb/gimppdbcontext.c
+++ b/app/pdb/gimppdbcontext.c
@@ -186,6 +186,12 @@ gimp_pdb_context_constructed (GObject *object)
                                                      GIMP_CONTEXT (context),
                                                      TRUE);
 
+  /* keep the stroke options in sync with the context */
+  gimp_context_define_properties (GIMP_CONTEXT (context->stroke_options),
+                                  GIMP_CONTEXT_PROP_MASK_ALL, FALSE);
+  gimp_context_set_parent (GIMP_CONTEXT (context->stroke_options),
+                           GIMP_CONTEXT (context));
+
   /* preserve the traditional PDB default */
   g_object_set (context->stroke_options,
                 "method", GIMP_STROKE_PAINT_METHOD,
@@ -401,8 +407,6 @@ gimp_pdb_context_new (Gimp        *gimp,
                           "name", "PDB Context",
                           NULL);
 
-  gimp_config_sync (G_OBJECT (parent), G_OBJECT (context), 0);
-
   if (set_parent)
     {
       gimp_context_define_properties (GIMP_CONTEXT (context),
@@ -437,6 +441,12 @@ gimp_pdb_context_new (Gimp        *gimp,
                         0);
     }
 
+  /*  copy the context properties last, they might have been
+   *  overwritten by the above copying of stroke options, which have
+   *  the pdb context as parent
+   */
+  gimp_config_sync (G_OBJECT (parent), G_OBJECT (context), 0);
+
   return GIMP_CONTEXT (context);
 }
 


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