amarullz / windowgestures

GNOME Extension to Manage window with touchpad gestures
https://amarullz.com/
GNU General Public License v2.0
44 stars 6 forks source link

Back Forward navigation or other actions (global or per-app) using three finger hold and swipe left / right gesture #9

Closed sidevesh closed 8 months ago

sidevesh commented 9 months ago

Adding only to track things that gnome-gesture-improvements had implemented, honestly don't see this personally as too important since most GTK4 apps already have overscroll navigation and chromium also supports this on Wayland if enabled using launch flags.

amarullz commented 9 months ago

What actuality Back Forward navigation is?

sidevesh commented 9 months ago

Screencast from 2023-10-11 14-15-16.webm This is what that looks like, this is built into chromium on wayland but gnome-gesture-improvements allowed to do this on every app with 3 finger hold and swipe left / right, and it also allowed for setting the action to do on that gesture per app, so for example in the Photo Viewer you can swipe between photos left and right using the gesture. It also added teh arrow animation that you see in the video to every winfow when using that gesture.

amarullz commented 9 months ago

It's just back/forward hardware button (for action) right? but with interface arrow. But I still don't know how to implementing that back arrow indicator.

sidevesh commented 9 months ago

Yes, correct, it just triggers the back forward key events

amarullz commented 9 months ago

Can you give me video that works in another apps, like a photos.

sidevesh commented 9 months ago

I can't since upgrading to Gnome 45 gnome-gesture-improvements just does not work, the way it worked in gnome-gesture-improvements is that you can specify what the back and forward gestures did per app by setting a keyboard shortcut, so I think for the Photos app it was set to left and right arrow.

amarullz commented 9 months ago

It's like injecting widget into window. Is it internal chrome indicator, or in other apps the indicator is also visible?

sidevesh commented 9 months ago

no, so the video I sent is chromium's built in overscroll navigation indicator, not related to gnome or the extension at all, gnome-gesture-improvements just mimicked chromium's back and forward indicator animation for its own hold 3 finger and swipe gesture, and that mimicked arrow indicator was visible in all apps, when using gnome-gesture-improvements's gesture, let me know if that did not make sense.

sidevesh commented 9 months ago
    <!-- 
      0 -> Default
      1 -> Forward/Back
      2 -> PageUP/PageDown
      3 -> Right/Left
      4 -> Audio Next/Prev
      5 -> Tab Next/Prev
      boolean value is to indicate whether to reverse keybinds
    -->
    <key name="forward-back-application-keyboard-shortcuts" type="a{s(ib)}">
      <default>
        {
          'firefox.desktop': (5, false),
          'org.chromium.Chromium.desktop': (5, false),
          'microsoft-edge.desktop': (5, false),
          'google-chrome.desktop': (5, false),
          'org.gnome.gThumb.desktop': (2, false),
          'org.gnome.eog.desktop': (3, false),
          'org.gnome.Photos.desktop': (3, false),
          'shotwell.desktop': (3, false),
          'com.spotify.Client.desktop': (4, false),
          'code.desktop': (5, false),
          'code-insiders.desktop': (5, false),
          'org.gnome.Terminal.desktop': (5, false),
          'com.gexperts.Tilix.desktop': (5, false),
          'org.gnome.TextEditor.desktop': (5, false)
        }
      </default>

Found this in gnome-gesture-improvements

amarullz commented 9 months ago

Maybe the chromium one is also mimicked arrow 🫣

amarullz commented 9 months ago

Yes, it was mimicked arrow: https://github.com/harshadgavali/gnome-gesture-improvements/blob/main/extension/src/animations/arrow.ts

amarullz commented 9 months ago

Can you test this update?

Screencast from 2023-10-12 22-04-34.webm

amarullz commented 9 months ago

Will make swipe left/right action configurable.

TODO: Configurable Gesture

sidevesh commented 9 months ago

https://github.com/amarullz/windowgestures/assets/17254413/e405fe9e-c6c7-4c46-8bb0-55b8af362a5a

It conflicts with pinch to zoom I guess, sometimes it works, sometimes it does not, in this video back gesture isn't working but forward is, when I had tried earlier, back was working but forward wasn't and back left a faint back arrow even after gesture ended.

Also this should not be configurable to pinch at all since its a very back UX, and conflicts with expectation of pinch is for zoom and does not feel natural at all.

amarullz commented 9 months ago

windowgestures@extension.amarullz.com.zip ^- This fixes the left a faint back arrow

as I said before, I will implement customizable swipes

TODO: Configurable Gesture

  • 4 Finger swipe left
  • 4 Finger swipe right
  • 3 Finger swipe down
  • 3 Finger swipe down and left/right

Currently i don't have a problem with pinch conflict with zoom pinch (pinch 2 finger), but will find solutions.