How to make infinite-scrolling GUI widgets under Wayland ?

Jean-Michaël Celerier jeanmichael.celerier at gmail.com
Mon Apr 26 14:57:01 UTC 2021


Hello,
I am working on the multimedia sequencer ossia score (https://ossia.io).

I am trying to make sure that it works fine for Linux users under wayland.

For audio (and in general multimedia) apps, there is a very common family
of GUI widget which allows to scroll a value "infinitely" (or at least much
more than the height of the screen) - the usual user interaction is :
* User clicks on the widget : the mouse cursor disappears (some apps will
give a kind of highlight to the widget to indicate that it is being acted
upon)
* User moves their mouse upwards or downwards to increase the value
* At some point they reach the top or the bottom of the screen : to
continue scrolling transparently, the app translates the mouse cursor to
the top of the screen
* When the user releases the mouse the cursor reappears at the position
where it was clicked.

This is needed in two case :
- To make sliders / knobs with easily adjustable values
- To implement infinite- or at least very long scrolling in minimaps.

I made a few videos:
- Video 1: example of slider with the feature in Ableton Live (one of the
most used music making app) : https://streamable.com/ecepvc

- Video 2 : example of minimap in Ableton Live :
https://streamable.com/epc7r1

- Video 3 : Example of the pain induced by software that do not support the
feature: here I want to change the tempo but cannot because the mouse hits
the top of the screen. Thus I have to release and go click on it again :
https://streamable.com/bniht5

Thus, my question is : what must I do as the developer of such an app to
make sure that my users will have widgets that will work "as expected" for
people in the media creation field, whatever the wayland compositor my
users are using (KDE Plasma, GNOME, sway...). I don't want them to have an
inferior user experience on Linux when compared to other operating systems.

The googling I've done so far seems to say that there is no way to position
the cursor absolutely directly through wayland, but the only other way
seems to be through /dev/uinput which needs root permissions to write to
(and my userbase are artists who generally don't have the technical
skillset to know that they must mark things as root; I could always check
and show a popup that requests the user to do chmod u+rwx on /dev/uinput on
startup but that would be my last resort...)

Thanks !
Jean-Michaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20210426/e1fcd5cf/attachment.htm>


More information about the wayland-devel mailing list