From d13acea38a58d73d70ac8a3b70401e6764147505 Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Mon, 31 Jul 2023 21:13:27 +0200 Subject: [PATCH] imageView: Deny DragSource for touchscreens Before, the DragSource gesture was claimed on touchscreens, while no dnd was available there anyways. This caused swiping through images to only work unreliably. Issue #176 Part-of: --- src/widgets/image_view.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/widgets/image_view.rs b/src/widgets/image_view.rs index 4d00478..60fb5fc 100644 --- a/src/widgets/image_view.rs +++ b/src/widgets/image_view.rs @@ -174,8 +174,11 @@ mod imp { .current_page() .map(|p| p.image().is_hscrollable() || p.image().is_vscrollable()); - // do scrolling if scrollable - if is_scrollable == Some(true) { + if is_scrollable == Some(true) + || gesture.device().map(|x| x.source()) + == Some(gdk::InputSource::Touchscreen) + { + // Do scrolling if scrollable and no drag and drop on touchscreen gesture.set_state(gtk::EventSequenceState::Denied); None } else {