Commit 1ce630e9 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

don't add the same target multiple times. This used to happen when

2005-03-26  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdnd.c: don't add the same target multiple times.
	This used to happen when  gimp_dnd_foo_source_add() is called
	after calling gimp_dnd_drag_source_set_by_type().
parent bf8759df
2005-03-26 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdnd.c: don't add the same target multiple times.
This used to happen when gimp_dnd_foo_source_add() is called
after calling gimp_dnd_drag_source_set_by_type().
2005-03-26 Sven Neumann <sven@gimp.org>
* libgimp/gimpdrawablecombobox.c
......
......@@ -625,6 +625,24 @@ gimp_dnd_init (Gimp *gimp)
}
/**********************/
/* helper functions */
/**********************/
static void
gimp_dnd_target_list_add (GtkTargetList *list,
const GtkTargetEntry *entry)
{
GdkAtom atom = gdk_atom_intern (entry->target, FALSE);
guint info;
if (! gtk_target_list_find (list, atom, &info) || info != entry->info)
{
gtk_target_list_add (list, atom, entry->flags, entry->info);
}
}
/********************************/
/* general data dnd functions */
/********************************/
......@@ -878,11 +896,7 @@ gimp_dnd_data_source_add (GimpDndType data_type,
if (target_list)
{
GdkAtom atom = gdk_atom_intern (dnd_data->target_entry.target, TRUE);
gtk_target_list_add (target_list, atom,
dnd_data->target_entry.flags,
dnd_data->target_entry.info);
gimp_dnd_target_list_add (target_list, &dnd_data->target_entry);
}
else
{
......@@ -972,11 +986,7 @@ gimp_dnd_data_dest_add (GimpDndType data_type,
if (target_list)
{
GdkAtom atom = gdk_atom_intern (dnd_data->target_entry.target, TRUE);
gtk_target_list_add (target_list, atom,
dnd_data->target_entry.flags,
dnd_data->target_entry.info);
gimp_dnd_target_list_add (target_list, &dnd_data->target_entry);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment