[evince/951-unwanted-scrolling-highlighting-when-using-synctex-backward-search] ev-view.c: ignore unintended motion events while launching synctex

commit 2697c12744aa8dc588b8106d42716b6961208acb
Author: Nelson Benítez León <nbenitezl gmail com>
Date:   Sun Aug 5 12:45:22 2018 +0500

    ev-view.c: ignore unintended motion events while launching synctex
    Synctex is launched by a Ctrl+leftClick, but sometimes if we move
    mouse slightly when doing the click an unwanted  motion event is
    generated which will trigger a "extend text selection" action
    (because we have CTRL modifier pressed) and this happens just
    before we focus out of Evince, causing the symptoms described in
    Issue #951.
    Closes #951

 libview/ev-view.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/libview/ev-view.c b/libview/ev-view.c
index ff24b10b..a8afc789 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -5591,6 +5591,10 @@ ev_view_motion_notify_event (GtkWidget      *widget,
                        /* FIXME: reload only annotation area */
                        ev_view_reload_page (view, annot_page, NULL);
+               } else if (ev_document_has_synctex (view->document) && (event->state & GDK_CONTROL_MASK)) {
+                       /* Ignore spurious motion event triggered by slightly moving mouse
+                        * while clicking for launching synctex. Issue #951 */
+                       return TRUE;
                } else {
                        /* Schedule timeout to scroll during selection and additionally
                         * scroll once to allow arbitrary speed. */

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]