GeopJr / Tuba

Browse the Fediverse
https://tuba.geopjr.dev/
GNU General Public License v3.0
545 stars 59 forks source link

[Bug]: Back swipe does not work on page body #279

Open FineFindus opened 1 year ago

FineFindus commented 1 year ago

Describe the bug

When using the app with a touchpad, the swipe back gesture works correctly on the headerbar, allowing the user to navigate back to the previous screen. However, the swipe back gesture does not function on the page body, where it stops after a short movement. The length of the movement seems to be related to the swiping speed, the faster you swipe, the further it retracts. When swiping extremely fast, the gesture actually works (sometimes).

Steps To Reproduce

  1. Goto a screen with a single post
  2. Use a vertical swipe on the page to go back
  3. Notice how it only work on the header bar

Logs and/or Screenshots

Swipe example

Instance Backend

Mastodon

Operating System

Ubuntu 23.04

Package

Flatpak

Troubleshooting information

os: GNOME 44 (Flatpak runtime) prefix: /app flatpak: true version: 0.3.2 (production) gtk: 4.10.3 (4.10.3) libadwaita: 1.3.2 (1.3.2) libsoup: 3.4.1 (3.4.1) libgtksourceview: 5.8.0 (5.8.0)

Additional Context

This could possibly be related to https://github.com/GeopJr/Tuba/issues/187. As a side note, the back gesture does not work when a vertical scroll is available, this may be solvable, as it works correctly in Geary.

GeopJr commented 1 year ago

On further investigation, it has to do with the previous page's scrolledwindow:

Screencast from 2023-05-24 04-16-45.webm

when aligning the previous page to start, it works when hovering over the non-scrolledwindow side

switching the transition to over fixes it (but not all the time)

Screencast from 2023-05-24 04-19-57.webm

however "over" doesn't feel as natural as "under"

FineFindus commented 1 year ago

Interestingly enough, I was not able to replicate your first observation. Maybe the previous page intercepts the gesture? I'm able to scroll the previous page when the back gesture fails.

Scrolling the previous page when back gesture fails

imhemish commented 1 year ago

As far as I know, this has something to do with GTK, I remember asking in Libadwaita matrix group why sometimes touchpad gestures dont work in page body, but do work correctly in the headerbar, Alice (the main maintainer and developer of libadwaita) told me that this has something to do with GTK, and gestures dont work reliably inside of a scrolled widget. Gestures work when it can't be scrolled, so they work in headerbar.

CaptainMorgan12 commented 1 year ago

Only to confirm it happens to me with tuba on desktop where swipe in message body that was opened it only partially swipes back, but in headerbar it correctly swipes back fully using touchpad.

os: GNOME 44 (Flatpak runtime) prefix: /app flatpak: true version: 0.4.0 (production) gtk: 4.10.3 (4.10.3) libadwaita: 1.3.2 (1.3.2) libsoup: 3.4.2 (3.4.2) libgtksourceview: 5.8.0 (5.8.0) ubuntu 23.04

Interestingly the same swiping back for opened message body works fine on mobile device using touch input (swipe left edge to right) with one finger in scrollable message body. The scroll has to be cancelled, if you scroll up and down in body and then swipe back it does not work.

bugaevc commented 1 year ago

This sounds related to https://gitlab.gnome.org/GNOME/libadwaita/-/issues/16