[Spice-commits] src/spice-widget.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 18 07:10:48 UTC 2018


 src/spice-widget.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6a86dd8e723221d21cafee9a890ba5d7a22188af
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Sep 17 18:41:05 2018 +0200

    display: Trigger wheel scrolling after one 'click'
    
    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>
    Acked-by: Marc-André Lureau <marcandre.lureau at gmail.com>

diff --git a/src/spice-widget.c b/src/spice-widget.c
index 853c9df..312c640 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;


More information about the Spice-commits mailing list