Commit c8cf6513 authored by Tobias Deiminger's avatar Tobias Deiminger

Complete TextSelectorEngine if nothing selected

Selecting highlight tool, pressing left mouse button while over text, and
immediately releasing without dragging a selection caused inconsistent state.

It left TextSelectorEnigne in the state m_creationCompleted == false and
m_lockedItem == something. Then in continuous mode all events kept on being
propagated to TextSelectorEngine::event, even if the user started unrelated
interactions in the meantime. This caused various side effects.

It notably happened when you double clicked a finished highlight annotation,
as described in bug 426658.

We can go to m_creationComplete after release even without a selection,
because TextSelectorEngine::end and PageViewAnnotator::performRouteMouseOrTabletEvent
handle the case just fine, i.e. don't create an annotation but reset the state machine.

Fixes bug 426658 at least partially. I couldn't reproduce the described crash,
so no idea if that's also fixed.

BUG: 446658
parent 844363aa
Pipeline #37289 passed with stage
in 47 minutes and 33 seconds
......@@ -527,7 +527,7 @@ public:
selection = std::move(newselection);
}
}
} else if (type == Release && selection) {
} else if (type == Release) {
m_creationCompleted = true;
}
return rect;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment