devilhorns pushed a commit to branch master.

commit beda3a827a7714af1b98dc290e74990959892946
Author: Chris Michael <[email protected]>
Date:   Fri Aug 23 11:21:13 2013 +0100

    Handle mouse wheel events in the default pointer grab
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/bin/e_comp_wl.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 9d1321a..6de200a 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -977,7 +977,40 @@ _default_grab_button(struct wl_pointer_grab *grab, 
uint32_t timestamp, uint32_t
 
         disp = wl_client_get_display(wl_resource_get_client(resource));
         serial = wl_display_next_serial(disp);
-        wl_pointer_send_button(resource, serial, timestamp, button, state_w);
+
+        switch (button)
+          {
+           case BTN_LEFT:
+           case BTN_MIDDLE:
+           case BTN_RIGHT:
+             wl_pointer_send_button(resource, serial, timestamp, 
+                                    button, state_w);
+             break;
+           case 4:
+             if (state_w)
+               wl_pointer_send_axis(resource, timestamp, 
+                                    WL_POINTER_AXIS_VERTICAL_SCROLL, 
+                                    -wl_fixed_from_int(1));
+             break;
+           case 5:
+             if (state_w)
+               wl_pointer_send_axis(resource, timestamp, 
+                                    WL_POINTER_AXIS_VERTICAL_SCROLL, 
+                                    wl_fixed_from_int(1));
+             break;
+           case 6:
+             if (state_w)
+               wl_pointer_send_axis(resource, timestamp, 
+                                    WL_POINTER_AXIS_HORIZONTAL_SCROLL, 
+                                    -wl_fixed_from_int(1));
+             break;
+           case 7:
+             if (state_w)
+               wl_pointer_send_axis(resource, timestamp, 
+                                    WL_POINTER_AXIS_HORIZONTAL_SCROLL, 
+                                    wl_fixed_from_int(1));
+             break;
+          }
      }
 
    if (pointer->button_count == 0 &&

-- 

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk

Reply via email to