wayland: add support for wl_pointer frame/axis_source/axis_discrete/axis_stop

This adds support for the new wl_pointer events available in v5.

The wl_pointer.axis_source events can be ignored for the purposes here, the
main reason they exist is so that the combination of axis_source=finger and
axis_stop triggers kinetic scrolling. We don't need to care about the source,
axis_stop is enough for us to tell us when we're scrolling.

The wl_pointer.frame events group events together and is intended as a
mechanism to coalesce events together. This for example allows us to now
send a single GTK scroll event for a diagonal scroll. Previously, the two
wl_pointer.axis events had to be handled separately.

The wl_pointer.axis_discrete event sends mouse wheel clicks where
appropriate, and is translated into up/down/left/right scroll events.

https://bugzilla.gnome.org/show_bug.cgi?id=756729
This commit is contained in:
Peter Hutterer
2015-10-20 13:21:54 +10:00
committed by Carlos Garnacho
parent ac95bac5b8
commit 3fca36169a
4 changed files with 253 additions and 44 deletions

View File

@ -212,8 +212,10 @@ _gdk_wayland_display_add_seat (GdkWaylandDisplay *display_wayland,
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (display_wayland);
struct wl_seat *seat;
display_wayland->seat_version = MIN (version, 5);
seat = wl_registry_bind (display_wayland->wl_registry,
id, &wl_seat_interface, MIN (version, 4));
id, &wl_seat_interface,
display_wayland->seat_version);
_gdk_wayland_device_manager_add_seat (gdk_display->device_manager,
id, seat);
_gdk_wayland_display_async_roundtrip (display_wayland);