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: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/264>
This commit is contained in:
Sophie Herold 2023-07-31 21:13:27 +02:00
parent c4d8145dd3
commit d13acea38a

View file

@ -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 {