show/hide other layers not properly recorded in undo history

Bug #1358520 reported by Formerly Kevin Yin, now disabled
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
jazzynico

Bug Description

Create a document with a few layers (for example, the attached). Open the undo history and layers dialog.

Right click on a layer and show/hide other layers. Then do it again for the same layer. Note that the undo history doesn't record the second time.

Seen on Inkscape 0.91 x64 on Windows 8.1.

Tags: layers undo
Revision history for this message
Formerly Kevin Yin, now disabled (kyin) wrote :
Revision history for this message
Liam P. White (liampwhite) wrote :

Also verified with Inkscape 0.48.5 on Ubuntu Trusty.

Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Match 'Importance' to similar earlier report concerning layer changes and undo history (bug #1256463).

Please comment if you disagree, or if this corrupts the undo history and can lead to crashes later on.

Changed in inkscape:
importance: Undecided → Medium
importance: Medium → Low
Revision history for this message
jazzynico (jazzynico) wrote :

From src/document-undo.cpp:

" * \verbatim
   void sp_document_done( SPDocument *document );
   void sp_document_maybe_done( SPDocument *document, const unsigned char *key ) \endverbatim
 *
 * Both move the recent action list into the undo stack and clear the
 * list afterwards. While the first method does an unconditional push,
 * the second one first checks the key of the most recent stack entry. If
 * the keys are identical, the current action list is appended to the
 * existing stack entry, instead of pushing it onto its own. This
 * behaviour can be used to collect multi-step actions (like winding the
 * Gtk spinbutton) from the UI into a single undoable step."

Thus calling DocumentUndo::done for SP_VERB_LAYER_SOLO and SP_VERB_LAYER_LOCK_OTHERS in verbs.cpp would add a different undo history entry each time the actions are performed instead of one (all actions can be undone with a single undo action) currently.

Changed in inkscape:
status: Confirmed → In Progress
assignee: nobody → jazzynico (jazzynico)
milestone: none → 0.91
Revision history for this message
jazzynico (jazzynico) wrote :

Patch attached.

Could you please test and confirm the new behavior is correct?

Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed revision 13572.

Changed in inkscape:
status: In Progress → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.