After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755619 - Crash on middle or right mouse click when adding annotations
Crash on middle or right mouse click when adding annotations
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: pdf annotations
3.18.x
Other Linux
: High normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-25 09:56 UTC by gnome
Modified: 2015-10-15 20:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libview: Ignore right clicks while in annotation add mode. (946 bytes, patch)
2015-09-30 08:39 UTC, José Aliste
committed Details | Review

Description gnome 2015-09-25 09:56:45 UTC
1. Open a PDF in Evince 3.18.0
2. Click annotate the document
3. Click either add text annotation or add highlight annotation
4. Middle click or right click in the document
5. Evince crashes: EvinceView:ERROR:ev-view.c:5631:ev_view_button_release_event: assertion failed: (view->pressed_button == 1)

Using Evince 3.18 from Debian sid.
Comment 1 Germán Poo-Caamaño 2015-09-29 21:28:29 UTC
Easy to reproduce. Thanks for the clear report.
Comment 2 José Aliste 2015-09-30 08:39:35 UTC
Created attachment 312403 [details] [review]
libview: Ignore right clicks while in annotation add mode.
Comment 3 José Aliste 2015-09-30 08:41:39 UTC
I think it is safe to assume that a middle or right click while in "adding annotation" mode 
is a non-voluntary mistake from the user... so I propose that doing middle or right click should do nothing. Thus, the above patch just ignores non-left clicks  and removes the failing assertion.
Comment 4 Germán Poo-Caamaño 2015-10-14 16:45:10 UTC
Review of attachment 312403 [details] [review]:

::: libview/ev-view.c
@@ +5632,3 @@
 
+		/* We ignore right-click buttons while in annotation add mode */
+		if (view->pressed_button != 1)

Although we have this all over the place, maybe it is time to start using mnemonics for the buttons, like to use GDK_BUTTON_PRIMARY instead of 1.
Comment 5 Carlos Garcia Campos 2015-10-15 09:39:05 UTC
Comment on attachment 312403 [details] [review]
libview: Ignore right clicks while in annotation add mode.

Ok
Comment 6 José Aliste 2015-10-15 20:20:04 UTC
Review of attachment 312403 [details] [review]:

Thanks
Comment 7 José Aliste 2015-10-15 20:20:27 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.