[4/6] [PATCH spice-gtk] Add horizontal mouse wheel support

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

 



Signed-off-by: Matthew Francis <mjay.francis@xxxxxxxxx>
---
 configure.ac       | 2 +-
 src/spice-widget.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 8fd525b..6c50e3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,7 @@ AC_CHECK_LIBM
 AC_SUBST(LIBM)
 
 AC_CONFIG_SUBDIRS([spice-common])
-PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol >= 0.12.13])
+PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol >= 0.12.14])
 
 COMMON_CFLAGS='-I${top_builddir}/spice-common/ -I${top_srcdir}/spice-common/ ${SPICE_PROTOCOL_CFLAGS}'
 AC_SUBST(COMMON_CFLAGS)
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 5365222..baec454 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -1906,6 +1906,8 @@ static int button_gdk_to_spice(guint gdk)
         [ 3 ] = SPICE_MOUSE_BUTTON_RIGHT,
         [ 4 ] = SPICE_MOUSE_BUTTON_UP,
         [ 5 ] = SPICE_MOUSE_BUTTON_DOWN,
+        [ 6 ] = SPICE_MOUSE_BUTTON_WHEEL_LEFT,
+        [ 7 ] = SPICE_MOUSE_BUTTON_WHEEL_RIGHT,
     };
 
     if (gdk < SPICE_N_ELEMENTS(map)) {
@@ -2030,6 +2032,10 @@ static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *scroll)
         button = SPICE_MOUSE_BUTTON_UP;
     else if (scroll->direction == GDK_SCROLL_DOWN)
         button = SPICE_MOUSE_BUTTON_DOWN;
+    else if (scroll->direction == GDK_SCROLL_LEFT)
+        button = SPICE_MOUSE_BUTTON_WHEEL_LEFT;
+    else if (scroll->direction == GDK_SCROLL_RIGHT)
+        button = SPICE_MOUSE_BUTTON_WHEEL_RIGHT;
     else {
         DISPLAY_DEBUG(display, "unsupported scroll direction");
         return true;
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]