Message ID | 87o9zmk177.fsf_-_@mail.parknet.co.jp |
---|---|
State | New |
Headers | show |
On Do, 2017-01-05 at 05:41 +0900, OGAWA Hirofumi wrote: > On 3.4.0 or later, send GDK_SCROLL_SMOOTH event, instead of > GDK_SCROLL_UP/DOWN. > > This fixes it by converting any smooth scroll to up/down. > (I.e. without smooth support) > > Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Added to ui queue. thanks, Gerd
diff -puN ui/gtk.c~mouse-wheel-fix ui/gtk.c --- qemu/ui/gtk.c~mouse-wheel-fix 2016-12-28 04:52:07.848682967 +0900 +++ qemu-hirofumi/ui/gtk.c 2017-01-05 05:38:24.200601498 +0900 @@ -1015,6 +1015,19 @@ static gboolean gd_scroll_event(GtkWidge btn = INPUT_BUTTON_WHEEL_UP; } else if (scroll->direction == GDK_SCROLL_DOWN) { btn = INPUT_BUTTON_WHEEL_DOWN; +#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 } else { return TRUE; }
On 3.4.0 or later, send GDK_SCROLL_SMOOTH event, instead of GDK_SCROLL_UP/DOWN. This fixes it by converting any smooth scroll to up/down. (I.e. without smooth support) Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> --- ui/gtk.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)