Dragging handles results in calls to sp_style_read_from_prefs()

Bug #1327267 reported by Tavmjong Bah on 2014-06-06
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Liam P. White

Bug Description

Dragging any handle results in calls to sp_style_read_from_prefs() with path "/tools/text" even if the text dialog is not open and the Text Tool is not being used. This seems to not be very efficient.

To see, add:

    std::cout << "sp_style_read_from_prefs: entrance: " << path << std::endl;

at the beginning of the function (in src/style.cpp).

Why is this happening? How can it be prevented?

This is one of a whole class of performance related issues where functions are being called too often.

jazzynico (jazzynico) wrote :

Also shows when selecting, deselecting or moving a shape.

Apparently the callers are both the font lister and the text toolbar. I've added some more debug code in the potential callers (libnrtype/font-lister.cpp, widgets/dash-selector.cpp, widgets/text-toolbar.cpp, and ui/dialog/text-edit.cpp), and selecting a simple rectangle returns:
----
sp_style_read_from_prefs: entrance: /tools/text
-> From font-lister
sp_style_read_from_prefs: entrance: /tools/text
-> From text-toolbar
----

Changed in inkscape:
status: New → Confirmed
jazzynico (jazzynico) wrote :

> Why is this happening?

The text toolbar is connected to the desktop so that a selection change (objects selected or deselected) updates its values with the ones of the selection or with the default values (if the selection has no text object).
The other toolbars (at least the ones I have checked) seem to behave the same way, but the main difference is that the text toolbar is also updated when the selection is modified (moved, resized...).

jazzynico (jazzynico) wrote :

To be precise, there are 3 connections in the text-toolbar code:
* c_selection_changed
* c_selection_modified
* c_subselection_changed

c_selection_changed is necessary to update the toolbar when the text object is modified (or when the select tool is activated) . And c_subselection_changed is needed when parts of the text are selected (with the text tool activated). But I see no reason why c_selection_modified exists. To resize the text bounding box, you need to switch to the selector tool, and switching back to the text tool updates the control bar thanks to c_selection_changed...

I'm currently testing with the c_selection_modified code commented, and still see no regression.

su_v (suv-lp) on 2014-06-29
Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.91
Liam P. White (liampwhite) wrote :

The text toolbar only needs to update when the text context is activated, as far as I'm aware, so this patch will take care of that.

Changed in inkscape:
status: Confirmed → In Progress
assignee: nobody → Liam P. White (inkscapebrony)
tags: added: text
ScislaC (scislac) wrote :

Patch works as expected here.

jazzynico: Regarding the c_selection_modified, did your testing involve resizing flowtext frames? I'm not going on anything other than you mentioning needing to change to the selector tool to change the text bounding box.

Liam P. White (liampwhite) wrote :

Fix committed in lp:inkscape, r13497.

@ScislaC: thanks for testing!

Changed in inkscape:
status: In Progress → Fix Committed
Bryce Harrington (bryce) on 2015-02-23
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers