Skip to content

ev-view: Fix crash when releasing click with selected text holding click button

Gary Li requested to merge li-gary/evince:crash_select_hold_text_text_annot into main

Evince currently fails an annotation assertion and crashes if the user selects text, and while holding, press 's' and release the click.

This is because pressing 's' sets adding_annot to true. In the button release event handler, if its true then we proceed to save the annotation to the document. However, this release event corresponds to text selection, so in the button press handler we have not populated view->adding_annot_info.annot, resulting in a failed assertion in the release handler.

To fix this, add a condition to check if we are just coming out of text selection before doing annotation saving related logic.

Fixes #1861 (closed)

Merge request reports