[PATCH libinput 1/3] tools: print the device group in event-debug

Benjamin Tissoires benjamin.tissoires at gmail.com
Thu Feb 12 12:26:47 PST 2015


On Tue, Feb 10, 2015 at 1:50 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---

Reviewed-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>

>  tools/event-debug.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/tools/event-debug.c b/tools/event-debug.c
> index 297e47d..38a6e82 100644
> --- a/tools/event-debug.c
> +++ b/tools/event-debug.c
> @@ -122,13 +122,24 @@ print_device_notify(struct libinput_event *ev)
>  {
>         struct libinput_device *dev = libinput_event_get_device(ev);
>         struct libinput_seat *seat = libinput_device_get_seat(dev);
> +       struct libinput_device_group *group;
>         double w, h;
>         uint32_t scroll_methods;
> +       static int next_group_id = 0;
> +       intptr_t group_id;
>
> -       printf("%-33s %5s %7s",
> +       group = libinput_device_get_device_group(dev);
> +       group_id = (intptr_t)libinput_device_group_get_user_data(group);
> +       if (!group_id) {
> +               group_id = ++next_group_id;
> +               libinput_device_group_set_user_data(group, (void*)group_id);
> +       }
> +
> +       printf("%-33s %5s %7s group%d",
>                libinput_device_get_name(dev),
>                libinput_seat_get_physical_name(seat),
> -              libinput_seat_get_logical_name(seat));
> +              libinput_seat_get_logical_name(seat),
> +              (int)group_id);
>
>         printf(" cap:");
>         if (libinput_device_has_capability(dev,
> --
> 2.1.0
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list