gtktoolpalette: Only call gdk_atom_intern when we're constructed

Otherwise we end up trying to instantiate a display manager in
class_init which breaks introspection scanning.

https://bugzilla.gnome.org/show_bug.cgi?id=696457
This commit is contained in:
Colin Walters 2013-03-23 14:09:20 -04:00
parent d6b4e84957
commit 4f0e9cbf81

View File

@ -216,6 +216,12 @@ gtk_tool_palette_init (GtkToolPalette *palette)
palette->priv->style_set = FALSE; palette->priv->style_set = FALSE;
palette->priv->text_size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH); palette->priv->text_size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
if (dnd_target_atom_item == GDK_NONE)
{
dnd_target_atom_item = gdk_atom_intern_static_string (dnd_targets[0].target);
dnd_target_atom_group = gdk_atom_intern_static_string (dnd_targets[1].target);
}
} }
static void static void
@ -1080,9 +1086,6 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
GTK_PARAM_READWRITE)); GTK_PARAM_READWRITE));
g_type_class_add_private (cls, sizeof (GtkToolPalettePrivate)); g_type_class_add_private (cls, sizeof (GtkToolPalettePrivate));
dnd_target_atom_item = gdk_atom_intern_static_string (dnd_targets[0].target);
dnd_target_atom_group = gdk_atom_intern_static_string (dnd_targets[1].target);
} }
/** /**