CLI: Extensions need GUI

When I run Inkscape in CLI mode, and want to run an extension that needs currently selected elements, the currently selected elements are only passed if the CLI is run in GUI mode (with --batch-process parameter).
Otherwise, no IDs of selected elements will be passed to the extension python script.
I tracked it down to src/extension/implementation/script.cpp, where the _change_extension method is called from two different methods (both are overloaded Script::effect methods), one is for the case where a desktop is available, the other was added for "pure document version for calling an extension from the command line", and has no desktop.
But the current selection still can be extracted from the SPdocument*, so I made this patch that duplicates the passing of the selected elements as parameters to the extension from the other effect() method.
participants (1)
-
Alexander Roalter