GNOME Bugzilla – Bug 148852
toggling layer mask activation does not set dirty flag
Last modified: 2005-03-24 17:40:02 UTC
When inversing the activation of a layer mask (Ctrl + left click on layer mask), the dirty flag is never set.
With current CVS, when I save a one-layer image with active layer mask, disable the layer mask, and then immediately close the image, I get: Gimp-Core-CRITICAL **: file gimplayermask.c: line 246 (gimp_layer_mask_get_layer): assertion `GIMP_IS_LAYER_MASK (layer_mask)' failed Running in gdb with --g-fatal-warnings, I get the following stack trace:
+ Trace 53347
Changing milestone to 2.2 because this seems like something that ought to be solved.
Further information: it seems that the CRITICAL error comes whenever you try to close an image in which the active drawable is a layer mask, regardless of other things, as far as I can tell. My guess at the cause is that somehow gimp_layer_mask_get_layer() is being called after the layer has been deleted -- but of course this could be completely off base.
Fixed the warning, changing milestone back to Future. 2004-12-10 Michael Natterer <mitch@gimp.org> * app/widgets/gimpcontainertreeview.c (gimp_container_tree_view_clear_items): clear all viewable cell renderers so they don't keep pointers to layers/masks which don't exist any more. Fixes the additional problem in bug #148852 but not the bug itself.
Created attachment 39095 [details] [review] patch for several assorted files in app Here is a patch that I think does more or less the right thing. The main question I have is whether it is okay to push an undo in a function in actions/layers-commands.c, or whether this should be moved elsewhere.
I'm afraid this is slightly wrong. There are two other layer mask properties which are still not undoable (edit and show). I propose to add a generic undo_push_layer_properties() which saves all 3 properties. Then, all the gimp_layer_mask_set_apply,edit,show() should have "gboolean push_undo" parameters, and the undo system should use the same API with push_undo = FALSE.
Okay, I rewrote it exactly as described. 2005-03-23 Bill Skaggs <weskaggs@primate.ucdavis.edu> * app/core/core-enums.[ch] * app/core/gimpimage-undo-push.[ch] * app/pdb/pdb_glue.h * app/actions/layers-commands.c: make layer mask property changes undoable, should fix bug #148852. Note that a little shape-layer stuff is in core-enums, will be needed shortly. This should definitely not be backported.
You didn't commit all changed files and some of the changes you committed to gimpimage-undo-push.[ch] were related to shape layers. In other words, it didn't build and wasn't trivial to fix. I have thus reverted this commit. If you need a patch of your changes, ask me.
Seems to work fine now. Closing as FIXED.