GNOME's Mutter Lands Implicit Grabbing In Clutter To Enhance Gesture Handling

Written by Michael Larabel in GNOME on 12 February 2023 at 07:41 AM EST. 2 Comments
GNOME
A ten month old merge request to GNOME's Mutter for adding implicit grabbing to the Clutter code was finally merged last week.

Jonas Dreßler wrote in the merge request first opened ten months ago as their first step to new gestures support:
It's a beautiful Sunday for sitting outside and coding and we haven't introduced a new grabbing mechanism for at least 2 months, so why not do that?

This introduces the necessary infrastructure to implement ClutterActions for tracking pointer/touch gestures. The goal of this is to see all events of a button press->motion->release or a touch begin->update->end sequence in the ClutterAction, without having to make assumptions about a point getting invalid or disappearing beneath our feet.

Jonas also went on to further elaborate in the commit adding the implicit button/touch grabbing to Clutter:
We'll soon introduce a new gesture tracking framework which heavily depends on ClutterActions seeing all events of a sequence. For this to work, a larger change to event delivery is needed: Implicit grabbing of all events for button and touch press->motion->release sequences to ensure ClutterActions continue receiving events for the whole sequence.

This commit takes care of that: At the start of an event sequence we collect all the event-handling actors and actions to a GArray that lives in the PointerDeviceEntry, and then deliver all events belonging to that sequence to the same actors/actions until the sequence ends.

This merge working toward new gestures support in Mutter will be part of the GNOME 44 release due out next month. That though is just the first step and still open is the second part that introduces the new gesture tracker code, which remains to be seen if it will land in time for the GNOME 44 milestone.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week