[gimp/gimp-2-8] Bug 69496 - Paint tools, Text tool: Click and drag font/brush/pattern/gradient...



commit bfd482755b081be7dbda2fd1d457d1b6b7ace8a8
Author: Julien Nabet <serval2412 yahoo fr>
Date:   Tue Sep 8 21:34:11 2015 +0200

    Bug 69496 - Paint tools, Text tool: Click and drag font/brush/pattern/gradient...
    
    ...from tool options crashes GIMP
    
    Applied a modified patch that actually removes the target list if it
    became empty. This may or may not fix the bug; I can't tell because I
    couldn't reproduce it any longer.
    
    (cherry picked from commit 456d535232ce781ffbb5f28d68dc91308154c0f8)

 app/widgets/gimpdnd.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/app/widgets/gimpdnd.c b/app/widgets/gimpdnd.c
index 5f52a00..609f52e 100644
--- a/app/widgets/gimpdnd.c
+++ b/app/widgets/gimpdnd.c
@@ -913,12 +913,13 @@ gimp_dnd_data_source_add (GimpDndType  data_type,
     }
 }
 
-static void
+static gboolean
 gimp_dnd_data_source_remove (GimpDndType  data_type,
                              GtkWidget   *widget)
 {
   const GimpDndDataDef *dnd_data;
   gboolean              drag_connected;
+  gboolean              list_changed = FALSE;
 
   drag_connected =
     GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
@@ -973,10 +974,22 @@ gimp_dnd_data_source_remove (GimpDndType  data_type,
 
           gtk_target_table_free (targets, n_targets);
 
-          gtk_drag_source_set_target_list (widget, new_list);
+          if (g_list_length (target_list->list) !=
+              g_list_length (new_list->list))
+            {
+              list_changed = TRUE;
+
+              if (new_list->list)
+                gtk_drag_source_set_target_list (widget, new_list);
+              else
+                gtk_drag_source_set_target_list (widget, NULL);
+            }
+
           gtk_target_list_unref (new_list);
         }
     }
+
+  return list_changed;
 }
 
 static void
@@ -1991,9 +2004,7 @@ gimp_dnd_viewable_source_remove (GtkWidget *widget,
   if (dnd_type == GIMP_DND_TYPE_NONE)
     return FALSE;
 
-  gimp_dnd_data_source_remove (dnd_type, widget);
-
-  return TRUE;
+  return gimp_dnd_data_source_remove (dnd_type, widget);
 }
 
 gboolean


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