<div dir="ltr">Sure, I'll fix that.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 21, 2014 at 8:43 PM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Sun, Dec 21, 2014 at 02:39:02AM -0800, Dima Ryazanov wrote:<br>
> Currently, the indexes are off by 4 because of the scroll buttons.<br>
><br>
> Signed-off-by: Dima Ryazanov <<a href="mailto:dima@gmail.com">dima@gmail.com</a>><br>
> ---<br>
>  hw/xwayland/xwayland-input.c | 7 ++++++-<br>
>  1 file changed, 6 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c<br>
> index b8c543c..ad30c31 100644<br>
> --- a/hw/xwayland/xwayland-input.c<br>
> +++ b/hw/xwayland/xwayland-input.c<br>
> @@ -233,6 +233,9 @@ pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial,<br>
>      xwl_seat->xwl_screen->serial = serial;<br>
><br>
>      switch (button) {<br>
> +    case BTN_LEFT:<br>
> +        index = 1;<br>
> +        break;<br>
>      case BTN_MIDDLE:<br>
>          index = 2;<br>
>          break;<br>
> @@ -240,7 +243,9 @@ pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial,<br>
>          index = 3;<br>
>          break;<br>
>      default:<br>
> -        index = button - BTN_LEFT + 1;<br>
> +        /* Skip indexes 4-7: they are used for vertical and horizontal scroll.<br>
> +           The rest of the buttons go in order: BTN_LEFT + 3 becomes 8, etc. */<br>
> +        index = button - BTN_LEFT + 5;<br>
<br>
</div></div>tbh, I'd use 8 + button - BTN_SIDE here, that's less confusing (and is what<br>
we do in e.g. evdev). but either way,<br>
<br>
Reviewed-by: Peter Hutterer <<a href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a>><br>
<br>
Cheers,<br>
   Peter<br>
</blockquote></div><br></div>