New blank document after closing last window doesn't set current layer from template

Bug #1053024 reported by su_v on 2012-09-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Follow-up report to
Bug #170550 (sf1106380) “open blank document on 'close'”

With current trunk (>= r11632) a blank document based on the default template is opened when closing the last window. Unlike with 'File > New', this blank document window does not set the current layer according to the setting stored in <namedview> of the default template. The current drawing level (as indicated in the layer selector widget in the status bar) instead is set outside the layer structure ('root').

Steps to reproduce:
1) mv ~/.config/inkscape{,-bkp}
2) launch inkscape (empty)
3) verify that current drawing level is "Layer 1" (as defined in the default template)
4) close window (Ctrl+W)
   (-> a new blank document is opened, reusing the current window)

Expected result:
In the new blank document, the current drawing level is also "Layer 1", as defined in the default template.

Actual result:
In the new blank document, the current drawing level is 'root' (top-level of the <svg> node).

Not reproduced with <= r11630, reproduced with r11632 and later revisions on OS X 10.7.4 (tested with GTK+/X11 2.24.10 and GTK+/Quartz 2.24.11 as well as with experimental GTK3 build. Locale ($LANG) is "en_US.UTF-8").

Tags: ui Edit Tag help
su_v (suv-lp) on 2012-09-19
description: updated
description: updated
su_v (suv-lp) on 2012-09-19
description: updated
su_v (suv-lp) wrote :

Works as expected (or at least as I expect it - 'root' as initial current layer IMHO is a major usability problem) with e.g. such a change:

$ bzr diff src/interface.cpp
=== modified file 'src/interface.cpp'
--- src/interface.cpp 2012-09-02 04:24:45 +0000
+++ src/interface.cpp 2012-09-19 20:06:40 +0000
@@ -322,6 +322,7 @@
         SPDocument *doc = SPDocument::createNewDoc( templateUri.c_str() , TRUE, true );
+ sp_namedview_update_layers_from_document(dt);

su_v (suv-lp) wrote :

Proposed fix - please review.

jazzynico (jazzynico) wrote :

Bug confirmed on Ubuntu 11.04, Inkscape trunk revision 11687.
Patch tested successfully on the same system.

Changed in inkscape:
assignee: nobody → ~suv (suv-lp)
importance: Undecided → Medium
status: New → In Progress
jazzynico (jazzynico) wrote :

Patch also tested on Windows XP. Feel free to commit!

su_v (suv-lp) wrote :

@JazzyNico - thx for confirming and testing.

@John Smith - would you mind to test/review the proposed changes?

John Smith (john-smithi) wrote :

Yes works well , thanks ~suv !

su_v (suv-lp) wrote :

Fix committed in r11689 - thanks for the review :-)

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

Other bug subscribers