qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ui/gtk: Fix mouse wheel on 3.4.0 or later


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH] ui/gtk: Fix mouse wheel on 3.4.0 or later
Date: Wed, 04 Jan 2017 09:48:45 +0100

> +#if GTK_CHECK_VERSION(3, 4, 0)
> +    } else if (scroll->direction == GDK_SCROLL_SMOOTH) {
> +        gdouble delta_x, delta_y;
> +        if (!gdk_event_get_scroll_deltas((GdkEvent*)scroll, &delta_x, 
> &delta_y))
> +            return TRUE;
> +        if (delta_y > 0)
> +            btn = INPUT_BUTTON_WHEEL_DOWN;
> +        else
> +            btn = INPUT_BUTTON_WHEEL_UP;
> +#endif

Patch looks good, except for some codestyle issues:

=== checkpatch complains ===
ERROR: "(foo*)" should be "(foo *)"
#13: FILE: ui/gtk.c:1024:
+        if (!gdk_event_get_scroll_deltas((GdkEvent*)scroll, &delta_x,
&delta_y))

ERROR: braces {} are necessary for all arms of this statement
#13: FILE: ui/gtk.c:1024:
+        if (!gdk_event_get_scroll_deltas((GdkEvent*)scroll, &delta_x,
&delta_y))
[...]

ERROR: braces {} are necessary for all arms of this statement
#15: FILE: ui/gtk.c:1026:
+        if (delta_y > 0)
[...]
+        else
[...]

total: 3 errors, 0 warnings, 16 lines checked

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]