Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-92179

get PanNativeGesture working where possible, and/or add deltas to SwipeNativeGesture

    XMLWordPrintable

Details

    • 31f90e99b8f04d9a228c5a0b01319b3f112c1490 (qt/qtbase/dev)

    Description

      QNativeGestureEvent does not have storage for a 2D displacement vector, or pair of deltas, to be able to describe the panning that the gesture requests. Maybe at some point the idea was to use value() to give the distance and some enum to give the direction, or value() to give the angle and just assume that it always moves some small increment; but that does not lend itself to building "fluid" UIs. More likely it was left unimplemented because we've only ever had native gestures on the macOS trackpad so far, and panning seems to be omitted from the set of gestures that other platforms provide. However, on Wayland, the so-called "swipe" gesture provides dx and dy. SwipeNativeGesture is already in use in its crippled one-shot way on macOS (from 10.6 and then obsolete already in 10.7) https://stackoverflow.com/questions/12748072/how-to-properly-use-swipewithevent-to-navigate-a-webview-obj-c/13716988 such that value() provides an angle, and the idea is to do a complete swipe after a single event rather than making it "fluid". If we consider that swiping will always be like that, maybe we can use PanNativeGesture for the case when dx and dy are available, because the difference between swiping and panning is unclear anyway.

      Alternatively, we could keep using SwipeNativeGesture but add the deltas: then it would be a bit like the situation with QWheelEvent, sometimes it has pixel deltas and sometimes it doesn't.

      They seem to call it panning rather than swiping on Windows though: https://docs.microsoft.com/en-us/windows/win32/wintouch/windows-touch-gestures-overview

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              srutledg Shawn Rutledge
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes