core: Add Lock Content to undo history

In 2.10, we did not add a Undo History item for "Lock Content"
in the History dockable. In 3.0, we add the item, but Ctrl+Z
doesn't work because we don't actually push the undo item to
the stack.
Comments in fb1a6725 indicate this was intentionally left off
in 2.10. However, it's more consistent in 3.0 to have all locks
behave the same when it comes to undo history.
This commit is contained in:
Alx Sa 2024-12-21 16:05:48 -05:00
parent 979e0bfd0f
commit e8c29f818e

View file

@ -2482,12 +2482,9 @@ gimp_item_set_lock_content (GimpItem *item,
{ {
if (push_undo && gimp_item_is_attached (item)) if (push_undo && gimp_item_is_attached (item))
{ {
/* Right now I don't think this should be pushed. */
#if 0
GimpImage *image = gimp_item_get_image (item); GimpImage *image = gimp_item_get_image (item);
gimp_image_undo_push_item_lock_content (image, NULL, item); gimp_image_undo_push_item_lock_content (image, NULL, item);
#endif
} }
GET_PRIVATE (item)->lock_content = lock_content; GET_PRIVATE (item)->lock_content = lock_content;