Tool parameters are shared between multiple windows, but changes are not reflected in the other window's settings
Migrated from: https://bugs.launchpad.net/inkscape/+bug/1347055
Steps to reproduce:
- open Inkscape
- activate Bezier tool and select an option (e.g. paraxial line segments)
- open a second document with file-> new
- note that paraxial line segments is activated here as well (good)
- change to another mode, e.g. BSplines, in the second window
- go to the first window and start to draw
What happened?
Drawing happens with the settings from the second window, although the tool settings still show the old settings.
The wrong settings even survive a tool change in the first window.
What should have happened?
Either the settings are really shared but then shown in the UI, or the settings are not shared and the windows don't influence each other.
This affects all tools, afaics.
Inkscape Version and Operating System:
- Inkscape Version: 1.1-dev (03ae7f7, 2020-01-04)
- Operating System: Windows 10
- Operating System version: 10.0.18362
Summary of comments
Suggested solution by Markus Engel:
I seem unable to come up with an elegant solution. Maybe this is a design flaw in how the tools are handled. Every time you switch the currently active tool, a new tool instance is created and the old one is destroyed.
If each window owned a set of tool instances that live as long as the window exists this wouldn't be a problem. Only on window creation every tool should read the prefs and when closing the window, every tool should write back its current state to the prefs. During window lifetime, a tool should only react to certain changes in the prefs (using the already existing PrefsObserver and the virtual set-method).
Currently, every change in a tool's settings is immediately written back to the prefs, e. g. in pencil-toolbar.cpp (sp_add_freehand_mode_toggle, freehand_mode_changed).
Originally reported for 0.48.