[gtk+/gtk-3-16] W32: Support horizontal mouse wheel scrolling



commit 932ed7cd512139545b8edb28ee27b86f76b4ef84
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Thu Apr 16 23:11:14 2015 +0000

    W32: Support horizontal mouse wheel scrolling
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748014

 gdk/win32/gdkevents-win32.c  |   10 ++++++++--
 gdk/win32/gdkmain-win32.c    |    1 +
 gdk/win32/gdkprivate-win32.h |    3 +++
 3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index c55cee0..7ff7c08 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2450,6 +2450,7 @@ gdk_event_translate (MSG  *msg,
       break;
 
     case WM_MOUSEWHEEL:
+    case WM_MOUSEHWHEEL:
       GDK_NOTE (EVENTS, g_print (" %d", (short) HIWORD (msg->wParam)));
 
       /* WM_MOUSEWHEEL is delivered to the focus window. Work around
@@ -2500,8 +2501,13 @@ gdk_event_translate (MSG  *msg,
 
       event = gdk_event_new (GDK_SCROLL);
       event->scroll.window = window;
-      event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ?
-       GDK_SCROLL_UP : GDK_SCROLL_DOWN;
+
+      if (msg->message == WM_MOUSEWHEEL)
+         event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ?
+           GDK_SCROLL_UP : GDK_SCROLL_DOWN;
+      else if (msg->message == WM_MOUSEHWHEEL)
+         event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ?
+           GDK_SCROLL_RIGHT : GDK_SCROLL_LEFT;
       event->scroll.time = _gdk_win32_get_next_tick (msg->time);
       event->scroll.x = (gint16) point.x;
       event->scroll.y = (gint16) point.y;
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index 905c729..b9f59d1 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -758,6 +758,7 @@ _gdk_win32_message_to_string (UINT msg)
       CASE (WM_MBUTTONUP);
       CASE (WM_MBUTTONDBLCLK);
       CASE (WM_MOUSEWHEEL);
+      CASE (WM_MOUSEHWHEEL);
       CASE (WM_XBUTTONDOWN);
       CASE (WM_XBUTTONUP);
       CASE (WM_XBUTTONDBLCLK);
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index acc3fca..4a2f9d3 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -90,6 +90,9 @@
 #ifndef WM_APPCOMMAND
 #define WM_APPCOMMAND 0x319
 #endif
+#ifndef WM_MOUSEHWHEEL
+#define WM_MOUSEHWHEEL 0x20E
+#endif
 
 #ifndef CF_DIBV5
 #define CF_DIBV5 17


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