implement GtkWidget::unrealize() and destroy the control pixmap. fixes

2005-11-17  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpgradienteditor.c: implement GtkWidget::unrealize()
	and destroy the control pixmap. fixes crash when moving the dialog
	to another display.

	* menus/dockable-menu.xml.in: added a separator before the
	"Move to Screen" submenu.
This commit is contained in:
Michael Natterer 2005-11-17 20:39:23 +00:00 committed by Michael Natterer
parent 8b6b8f413e
commit a8f0162fe8
3 changed files with 26 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2005-11-17 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpgradienteditor.c: implement GtkWidget::unrealize()
and destroy the control pixmap. fixes crash when moving the dialog
to another display.
* menus/dockable-menu.xml.in: added a separator before the
"Move to Screen" submenu.
2005-11-17 Michael Natterer <mitch@gimp.org>
* app/actions/window-actions.[ch]: connect to GdkDisplayManager

View file

@ -112,6 +112,7 @@ static GObject * gimp_gradient_editor_constructor (GType type,
static void gimp_gradient_editor_destroy (GtkObject *object);
static void gimp_gradient_editor_unmap (GtkWidget *widget);
static void gimp_gradient_editor_unrealize (GtkWidget *widget);
static void gimp_gradient_editor_set_data (GimpDataEditor *editor,
GimpData *data);
@ -289,6 +290,7 @@ gimp_gradient_editor_class_init (GimpGradientEditorClass *klass)
gtk_object_class->destroy = gimp_gradient_editor_destroy;
widget_class->unmap = gimp_gradient_editor_unmap;
widget_class->unrealize = gimp_gradient_editor_unrealize;
editor_class->set_data = gimp_gradient_editor_set_data;
editor_class->title = _("Gradient Editor");
@ -482,6 +484,20 @@ gimp_gradient_editor_unmap (GtkWidget *widget)
GTK_WIDGET_CLASS (parent_class)->unmap (widget);
}
static void
gimp_gradient_editor_unrealize (GtkWidget *widget)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (widget);
if (editor->control_pixmap)
{
g_object_unref (editor->control_pixmap);
editor->control_pixmap = NULL;
}
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
}
static void
gimp_gradient_editor_set_data (GimpDataEditor *editor,
GimpData *data)

View file

@ -33,6 +33,7 @@
<separator />
<menuitem action="dock-show-image-menu" />
<menuitem action="dock-auto-follow-active" />
<separator />
<menu action="dock-move-to-screen-menu" name="Move to Screen" />
</popup>
</ui>