Blob Blame History Raw
From 67a1ad97c385531746f754da7c12d1354840248d Mon Sep 17 00:00:00 2001
From: Martin Wimpress <code@flexion.org>
Date: Mon, 4 Nov 2019 18:57:50 +0000
Subject: [PATCH] libview: Reset `pressed_button` when starting Drag and Drop

If view->pressed_button is left set, when the Drag and Drop operation completes, Atril will act as if it is still in a selection event.

Adapted from: https://gitlab.gnome.org/GNOME/evince/commit/92828bb797742e04aadbfdd62ba1da36837c37cf
---
 libview/ev-view.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libview/ev-view.c b/libview/ev-view.c
index 02860a88..91d14cbf 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -4808,6 +4808,7 @@ ev_view_motion_notify_event (GtkWidget      *widget,
 					                 event->y);
 
 			view->selection_info.in_drag = FALSE;
+			view->pressed_button = -1;
 
 			gtk_target_list_unref (target_list);
 
@@ -4830,6 +4831,7 @@ ev_view_motion_notify_event (GtkWidget      *widget,
 					                 event->y);
 
 			view->image_dnd_info.in_drag = FALSE;
+			view->pressed_button = -1;
 
 			gtk_target_list_unref (target_list);
 
-- 
2.21.0