After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 148852 - toggling layer mask activation does not set dirty flag
toggling layer mask activation does not set dirty flag
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.0.x
Other All
: Normal minor
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-30 08:57 UTC by Philippe Queinnec
Modified: 2005-03-24 17:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for several assorted files in app (6.75 KB, patch)
2005-03-22 23:17 UTC, weskaggs
none Details | Review

Description Philippe Queinnec 2004-07-30 08:57:17 UTC
When inversing the activation of a layer mask (Ctrl + left click on layer mask),
the dirty flag is never set.
Comment 1 weskaggs 2004-12-09 19:38:43 UTC
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:

  • #0 ??
  • #1 raise
    from /lib/tls/libc.so.6
  • #2 abort
    from /lib/tls/libc.so.6
  • #3 g_logv
  • #4 g_log
  • #5 gimp_layer_mask_get_layer
    at gimplayermask.c line 249
  • #6 gimp_layer_tree_view_renderer_update
    at gimplayertreeview.c line 1202
  • #7 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #8 g_closure_invoke
    at gclosure.c line 437
  • #9 signal_emit_unlocked_R
    at gsignal.c line 2435
  • #10 g_signal_emit_valist
    at gsignal.c line 2194
  • #11 g_signal_emit
    at gsignal.c line 2238
  • #12 gimp_view_renderer_update
    at gimpviewrenderer.c line 554
  • #13 gimp_view_renderer_idle_update
    at gimpviewrenderer.c line 655
  • #14 g_idle_dispatch
    at gmain.c line 3802
  • #15 g_main_dispatch
    at gmain.c line 1942
  • #16 g_main_context_dispatch
    at gmain.c line 2492
  • #17 g_main_context_iterate
    at gmain.c line 2573
  • #18 g_main_loop_run
    at gmain.c line 2777
  • #19 app_run
    at app_procs.c line 375
  • #20 main
    at main.c line 473

Changing milestone to 2.2 because this seems like something that ought to be solved.
Comment 2 weskaggs 2004-12-09 19:57:23 UTC
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.
Comment 3 Michael Natterer 2004-12-10 17:56:56 UTC
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.
Comment 4 weskaggs 2005-03-22 23:17:22 UTC
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.
Comment 5 Michael Natterer 2005-03-23 10:57:41 UTC
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.
Comment 6 weskaggs 2005-03-24 02:18:54 UTC
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.
Comment 7 Sven Neumann 2005-03-24 10:39:48 UTC
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.
Comment 8 Sven Neumann 2005-03-24 17:40:02 UTC
Seems to work fine now. Closing as FIXED.