You Got A Question? Ask    GNOME Community!

 13663   |  Oct 25
 9740   |  Mar 17
 8634   |  Mar 28
 8405   |  Aug 25

Gnome 3.8 Features: Port Gnome-Shell to use XI2

This post was made with an older stylesheet

Benefits to Gnome

Even if MultiTouch support won’t be ready for 3.8 (the most likely scenario) Jasper Pierre which is responsible for this project, says:

The motivation I have for porting is pointer barriers, but it should improve other things, like smooth scrolling.

Modules that will be benefit from proper smooth scrolling support | (Bug #687573)

This adds some smooth scrolling support to scroll views. A quick grep shows a few other places we use scrolling:

  • Calendar for changing months.
  • Alt-tab for changing apps.
  • When over the volume status icon for adjusting volume.
  • Zooming into windows in the overview.
  • Sliders, like in the volume menu.
  • Combo boxes, like in the user status menu.
  • Lock screen, for lifting up (already has smooth scrolling support).
  • Looking glass, for going to parent actors in the inspector.
  • Over the workspaces view for selecting workspaces.
Jasper says:

Of these, I think sliders and window zooming in the overview are the only ones that make sense. For consistency, if we make the slider respect scroll deltas, it probably makes sense for the volume icon to do the same.

You can’t test smooth scrolling with gnome-shell yet, as it requires XI2 for mutter, but you can test with the interactive test-suite:

CLUTTER_ENABLE_XINPUT=1 ./tests/ ./tests/interactive/scrolling.js

With smooth scrolling and without. There is a difference but I don’t think that it is so big to screencasting.

Try it out

It is easy to try it if you have  JHBuild installed:

You will need a bugzilla account and enable your browser cookie:

 git config --global bz.browser google-chrome

This is for google-chrome, you should change this according to your browser, firefox, chromium etc..
Then install git-bz to apply the patches

curl > ~/.local/bin/git-bz
chmod +x ~/.local/bin/git-bz
git bz apply 687573

Recompile Gnome-Shell and you are done!

jhbuild buildone gnome-shell -n

Run this to your JHBuild Enviroment of course :)

CLUTTER_ENABLE_XINPUT=1 ./tests/ ./tests/interactive/scrolling.js

What Pointer Barriers is | Learn More

Compositing managers and desktop environments may have UI elements in particular screen locations such that for a single-headed display they correspond to easy targets according to Fitt’s Law, for example, the top left corner. For a multi-headed environment these corners should still be semi-impermeable. Pointer barriers allow the application to define additional constraint on cursor motion so that these areas behave as expected even in the face of multiple displays.

Absolute positioning devices like touchscreens do not obey pointer barriers. There’s no advantage to target acquisition to do so, since on a touchscreen all points are in some sense equally large, whereas for a relative positioning device the edges and corners are infinitely large.

Fitts’ Law | (Wikipedia)

Fitts’ law (often cited as Fitts’s law) is a model of human movement primarily used in human–computer interaction and ergonomics that predicts that the time required to rapidly move to a target area is a function of the distance to the target and the size of the target. Fitts’s law is used to model the act of pointing, either by physically touching an object with a hand or finger, or virtually, by pointing to an object on a computer monitor using a pointing device. It was proposed by Paul Fitts in 1954.

Why XI2


  • Explicit support for the master/slave device hierarchy. In X servers supporting XI2 there are two general types of devices – master devices and slave devices. Slave devices (SDs) usually represent a physical input device connected to the host computer. Master devices (MDs) are virtual input devices that are controlled by the physical input devices. Master devices appear as master pointers (i.e. a visible cursor) and master keyboards (i.e. a keyboard focus). Each time an SD generates an event, this event is passed through the MD to the respective application.
  • Support for multiple master devices. XI2 provides applications with the ability to create additional pairs of master devices (i.e one cursor and one keyboard focus). Through dynamic reattachment of SDs applications can control which physical device controls which visible cursor/keyboard focus. This allows multiple co-located users to collaborate on a single screen.
  • Support for 32 bit keycodes. Many multimedia keys cannot be processed in current X servers as the core protocol limits keycodes to a maximum of 255. Applications built against XI2 may receive keycodes up to 32 bit.
  • Support for latched/locked/base modifiers in input events.
  • Support for sub-pixel coordinates in input events.
  • Support for dynamic devices. Device may change capabilities at runtime (e.g. attaching additional buttons)
  • Support for relative motion events
  • Simplified API for retrieving device information and selecting and receiving input events.


Collabora and Tomeu Vizoso also work for Multi Gestures under Gnome. Tomeu in his blog says:

As can be seen in this example of a mutter plug-in, any subclass of ClutterGestureAction can be used, which includes gesture recognizers for panzoom and rotate actions, but creating new recognizers is pretty easy.

The mutter branch is up for reviewing in bugzilla and any comments on the approach will be very welcome. And if anybody wants to play with multi-touch gestures in Gnome Shell, please link to your work from the wiki so we can track it.

XI2 is about XServer and X Clients, while for Wayland there isn’t yet a discussion about a Multi-Gesture API, which it would be certainly exciting!

Port Gnome-Shell to use XI2 in Gnome Live!

  We can't watch comments unless G+ provides an API or if you send a notification, e.g +World Of Gnome
     Sometimes is better to place your questions on GNOME Community