ObjectSet::setBetween() emits a changed event for each selected object causing unresponsive GUI for large sets (fix included)
Summary:
ObjectSet::setBetween()
emits a changed event for each selected object causing unresponsive GUI for large sets. When ObjectSet::setBetween()
calls count += add(child);
it should actually call count += add(child, true);
like the Rubberband
selector does when it calls selection->addList (items);
or selection->setList (items);
in select-tool.cpp
.
Once everything is add
ed in the loop in setBetween
(with nosignal == true
), check that count > 0U
and then call _emitChanged()
manually if necessary. Also the setBetween
locals count
, min
, and max
should be unsigned.
Steps to reproduce:
- open Inkscape
- Create and select a simple object such as a 1mm x 1mm circle
- Edit -> Clone -> Create tiled Clone
- Choose parameters to create a large number (>1000) of tiled clones
- (Optional) select the generated clones by dragging a selection box over the canvas. Note the shortish delay.
- In the
Layers and Objects
menu, select the first object. - Scroll to the end of the list and select the last object.
- Wait or kill Inkscape because it might be a while before the canvas updates to reflect the new selection.
What happened?
Inkscape freezes entirely or takes a long time to reflect the selection was made on the canvas. Opening system monitor shows one thread pegged (presumably the GUI idle thread) during the freeze.
What should have happened?
Inkscape indicates the objects were selected.
Sample attachments:
You can select the tiled clones I generated here and avoid most of the setup to replicate the bug.
Version info
Various, currently running
Fixed here: Inkscape 1.5-dev (ceb1974f9d, 2024-04-28, custom)
Vanilla 1.5 built from master (commit hash above) has the bug.
Buggy here: Inkscape 1.3.2 (091e20ef0f, 2023-11-25)
System Info (Copy to clipboard button is apparently buggy, which is why I'm posting a screenshot: