[Spice-devel] [spice-gtk] display: Trigger wheel scrolling after one 'click'

Marc-André Lureau marcandre.lureau at gmail.com
Mon Sep 17 18:33:41 UTC 2018


On Mon, Sep 17, 2018 at 8:41 PM Christophe Fergeau <cfergeau at redhat.com> wrote:
>
> The scroll wheel on the mouse will trigger a smooth scroll event with a
> delta of +/-1.0. The code added in 2212f05 triggers a scroll when the
> delta is strictly greater than 1.0. This means that right after
> connecting a client, we won't be triggering a scroll with the first
> mouse wheel 'click'.
> This commit adjusts the check so that we try to scroll when the delta is
> equal or greater than 1.0.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1627823
>
> Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>

ack

> ---
>  src/spice-widget.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index 853c9df6..312c640a 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -1979,7 +1979,7 @@ static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *scroll)
>          break;
>      case GDK_SCROLL_SMOOTH:
>          d->scroll_delta_y += scroll->delta_y;
> -        while (ABS(d->scroll_delta_y) > 1) {
> +        while (ABS(d->scroll_delta_y) >= 1) {
>              if (d->scroll_delta_y < 0) {
>                  press_and_release(display, SPICE_MOUSE_BUTTON_UP, button_state);
>                  d->scroll_delta_y += 1;
> --
> 2.17.1
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel



-- 
Marc-André Lureau


More information about the Spice-devel mailing list