when dropping a drawable, do the undo_push_group_start() before creating

2000-04-01  Michael Natterer  <mitch@gimp.org>

	* app/disp_callbacks.c: when dropping a drawable, do the
	undo_push_group_start() before creating the new layer, otherwise
	the undo system will show obscure misbehaviour (the undo group is
	pushed correctly but no undo will be possible until an other undo
	is pushed).
This commit is contained in:
Michael Natterer
2000-04-01 21:56:23 +00:00
committed by Michael Natterer
parent 9a15485344
commit 902aea45e9
4 changed files with 35 additions and 21 deletions

View File

@ -1,3 +1,11 @@
2000-04-01 Michael Natterer <mitch@gimp.org>
* app/disp_callbacks.c: when dropping a drawable, do the
undo_push_group_start() before creating the new layer, otherwise
the undo system will show obscure misbehaviour (the undo group is
pushed correctly but no undo will be possible until an other undo
is pushed).
2000-04-01 Michael Natterer <mitch@gimp.org>
Backported the UI changes of the 3.1.x gimp-print plugin to the

View File

@ -805,16 +805,19 @@ gdisplay_drag_drop (GtkWidget *widget,
dest_width = dest_gimage->width;
dest_height = dest_gimage->height;
undo_push_group_start (dest_gimage, EDIT_PASTE_UNDO);
new_layer =
layer_new_from_tiles (dest_gimage, gimp_image_base_type_with_alpha(dest_gimage), tiles,
_("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE);
layer_new_from_tiles (dest_gimage,
gimp_image_base_type_with_alpha (dest_gimage),
tiles,
_("Pasted Layer"),
OPAQUE_OPACITY, NORMAL_MODE);
tile_manager_destroy (tiles);
if (new_layer)
{
undo_push_group_start (dest_gimage, EDIT_PASTE_UNDO);
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), dest_gimage);
off_x = (dest_gimage->width - src_width) / 2;
@ -824,12 +827,11 @@ gdisplay_drag_drop (GtkWidget *widget,
gimage_add_layer (dest_gimage, new_layer, -1);
undo_push_group_end (dest_gimage);
gdisplays_flush ();
return_val = TRUE;
undo_push_group_end (dest_gimage);
gdisplay_update_title (gdisp);
}
}
}

View File

@ -805,16 +805,19 @@ gdisplay_drag_drop (GtkWidget *widget,
dest_width = dest_gimage->width;
dest_height = dest_gimage->height;
undo_push_group_start (dest_gimage, EDIT_PASTE_UNDO);
new_layer =
layer_new_from_tiles (dest_gimage, gimp_image_base_type_with_alpha(dest_gimage), tiles,
_("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE);
layer_new_from_tiles (dest_gimage,
gimp_image_base_type_with_alpha (dest_gimage),
tiles,
_("Pasted Layer"),
OPAQUE_OPACITY, NORMAL_MODE);
tile_manager_destroy (tiles);
if (new_layer)
{
undo_push_group_start (dest_gimage, EDIT_PASTE_UNDO);
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), dest_gimage);
off_x = (dest_gimage->width - src_width) / 2;
@ -824,12 +827,11 @@ gdisplay_drag_drop (GtkWidget *widget,
gimage_add_layer (dest_gimage, new_layer, -1);
undo_push_group_end (dest_gimage);
gdisplays_flush ();
return_val = TRUE;
undo_push_group_end (dest_gimage);
gdisplay_update_title (gdisp);
}
}
}

View File

@ -805,16 +805,19 @@ gdisplay_drag_drop (GtkWidget *widget,
dest_width = dest_gimage->width;
dest_height = dest_gimage->height;
undo_push_group_start (dest_gimage, EDIT_PASTE_UNDO);
new_layer =
layer_new_from_tiles (dest_gimage, gimp_image_base_type_with_alpha(dest_gimage), tiles,
_("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE);
layer_new_from_tiles (dest_gimage,
gimp_image_base_type_with_alpha (dest_gimage),
tiles,
_("Pasted Layer"),
OPAQUE_OPACITY, NORMAL_MODE);
tile_manager_destroy (tiles);
if (new_layer)
{
undo_push_group_start (dest_gimage, EDIT_PASTE_UNDO);
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), dest_gimage);
off_x = (dest_gimage->width - src_width) / 2;
@ -824,12 +827,11 @@ gdisplay_drag_drop (GtkWidget *widget,
gimage_add_layer (dest_gimage, new_layer, -1);
undo_push_group_end (dest_gimage);
gdisplays_flush ();
return_val = TRUE;
undo_push_group_end (dest_gimage);
gdisplay_update_title (gdisp);
}
}
}