vlc | branch: master | Erwan Tulou <[email protected]> | Mon Jan 24 14:40:58 
2011 +0100| [28c4972c0563ec657f01b4e8a38a4358d8e209e1] | committer: Erwan Tulou

skins2(Linux): fix scrolling twice faster than expected

On Linux, two scrolling events were generated for each wheel step
(one on ButtonPress, one on ButtonRelease). This led to scrolling being
twice faster on Linux than it is on Windows.

This patch ensures that only one scroll event is issued for one step at the
mouse wheel.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=28c4972c0563ec657f01b4e8a38a4358d8e209e1
---

 modules/gui/skins2/x11/x11_loop.cpp |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/modules/gui/skins2/x11/x11_loop.cpp 
b/modules/gui/skins2/x11/x11_loop.cpp
index 24c1c3e..f3a3620 100644
--- a/modules/gui/skins2/x11/x11_loop.cpp
+++ b/modules/gui/skins2/x11/x11_loop.cpp
@@ -300,19 +300,25 @@ void X11Loop::handleX11Event()
                 case 4:
                 {
                     // Scroll up
-                    EvtScroll evt( getIntf(), event.xbutton.x,
-                                   event.xbutton.y, EvtScroll::kUp,
-                                   mod );
-                    pWin->processEvent( evt );
+                    if( event.type == ButtonPress )
+                    {
+                        EvtScroll evt( getIntf(), event.xbutton.x,
+                                       event.xbutton.y, EvtScroll::kUp,
+                                       mod );
+                        pWin->processEvent( evt );
+                    }
                     break;
                 }
                 case 5:
                 {
                     // Scroll down
-                    EvtScroll evt( getIntf(), event.xbutton.x,
-                                   event.xbutton.y, EvtScroll::kDown,
-                                   mod );
-                    pWin->processEvent( evt );
+                    if( event.type == ButtonPress )
+                    {
+                        EvtScroll evt( getIntf(), event.xbutton.x,
+                                       event.xbutton.y, EvtScroll::kDown,
+                                       mod );
+                        pWin->processEvent( evt );
+                    }
                     break;
                 }
             }

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to