GeopJr / Tuba

[On break until 2024-07-15] Browse the Fediverse
https://tuba.geopjr.dev/
GNU General Public License v3.0
511 stars 55 forks source link

[Bug]: Pinch to zoom gesture in image viewer does not work consistently #900

Closed TriVoxel closed 4 weeks ago

TriVoxel commented 3 months ago

Describe the bug

Sometimes I can use the touchpad pinch to zoom feature to zoom an image, sometimes not.

Steps To Reproduce

  1. Click an image to enlarge
  2. Use a reverse pinch gesture on your touchpad to zoom in

Logs and/or Screenshots

No response

Instance Backend

Mastodon

Operating System

Fedora Silverblue

Package

Flatpak

Troubleshooting information

os: GNOME 46 (Flatpak runtime) prefix: /app flatpak: true version: 0.7.2 (production) gtk: 4.14.1 (4.14.1) libadwaita: 1.5.0 (1.5.0) libsoup: 3.4.4 (3.4.4) libgtksourceview: 5.12.0 (5.12.0)

Additional Context

If it isn't working, I can drag around with my mouse and sometimes get it out of this state where I can't use a zoom gesture. Not entirely sure what causes it yet, but there's a 50/50 chance touchpad gestures work when I open Tuba.

GeopJr commented 3 months ago

Not sure if #902 #899 had something to do with it as well, I can't really reproduce it but in general you have to be very precise because there are too many gestures:

If while trying to pinch, you trigger the media viewer's swipe down accidentally, then that's the one that will happen

I think #902 will probably fix it, if you are keen to using devel builds, feel free to try it!

TriVoxel commented 3 months ago

Here are steps to easily reproduce 100% of the time:

  1. Click an image to open the image viewer
  2. Immediately close the image using the two finger swipe down gesture
  3. Repeat step 1-2 about 5-10 times. Make sure you are quick on step 2
  4. Open the image once again
  5. Pinch to zoom (should not work)

Additional notes:

If you do step 1-2 slowly, it will not happen. It seems like has something to do with clicking the image multiple times until it re-opens the image viewer which causes this. I basically spam left click as soon as I dismiss the image with the gesture until it re-opens. I also tend to close the image before the loading spinner disappears. This seems to be the best way to produce the issue. This obviously isn't how I normally get into this state, but it is a consistent way to do it in my testing. Perhaps I sometimes double click on an image? Unsure...

Workaround:

  1. Double-click the image to zoom in. The gesture should work now.
  2. Click and drag down to close the image viewer. The gesture should work now.
TriVoxel commented 3 months ago

Confirmed to still be an issue in main

Tested:

os: GNOME 46 (Flatpak runtime) prefix: /app flatpak: true version: main-f5bd1c9 (development) gtk: 4.13.9 (4.13.9) libadwaita: 1.5.0 (1.5.0) libsoup: 3.4.4 (3.4.4) libgtksourceview: 5.11.2 (5.11.2)

GeopJr commented 2 months ago

I see, thanks for the reproduction, I was able to reproduce it on main but not on the PR. You also tested on main but that PR wasn't merged yet! Sorry for not being very clear about it!

Let me merge it and let me know if you can reproduce it again! (If you have cloned the repo locally, do git pull to get the latest version of the repo)

TriVoxel commented 2 months ago

I see, thanks for the reproduction, I was able to reproduce it on main but not on the PR. You also tested on main but that PR wasn't merged yet! Sorry for not being very clear about it!

Let me merge it and let me know if you can reproduce it again! (If you have cloned the repo locally, do git pull to get the latest version of the repo)

It's actually worse in the new PR. It still happens, but I can't get it un-stuck by double-clicking to zoom, or by dragging with left click to close the image viewer.

On a brighter note, great work with the left/right scroll for image galleries! Fantastic! Feels good.

TriVoxel commented 2 months ago

What's odd: the rest of the gestures work perfectly fine. Scrolling left/right in the photo gallery works, scroll down to dismiss image viewer works, scroll left to right to go back in a leaflet works perfectly fine... literally all the other gestures work fine for me. I only have issues with the pinch to zoom.

GeopJr commented 1 month ago

Could you give #955 a try? (still cant reliably reproduce it :/)

TriVoxel commented 1 month ago

I will try to test this soon…