-
Committer:
Tarmac
-
Author(s):
Andrea Azzarone, Jay Taoko
-
Date:
2011-11-29 17:43:28 UTC
-
mfrom:
(523.1.4 nux-mouse-buttons-test)
-
Revision ID:
tarmac-20111129174328-xvc6dzv1duv8qttm
* Added mouse button test: only mouse buttons 1, 2 and 3 should generate mouse down/up events (jaytaoko)
* Merged with Nux Trunk.
* Tries to fix:
[*] Bug #775872: Menubar - horizontal scroll over a menu opens it
[*] Bug #809717: Horizontal scroll on maximize/restore window control restores window.
[*] Bug #837004: Horizontally scrolling while highlighting an item in the dash or on an indicator will open the item.
[*] a not reported bug: horizontally scrolling on minimize window control (-) blows up unity (at least on my laptop).
------------------
- Preface:
-------------------
In X11 the horizontal scroll and the vertical one are emulated using a wheel-to-button mapping. The wheel-to-button mapping always generates a press followed instantly by a release.
As you know currently nux doesn't support horizontal scroll.
------------------------
- What happens in nux
------------------------
So in the mouse_press function (GraphicsDisplayX11.cpp) and in the mouse_release one is setted to NUX_MOUSE_PRESSED and NUX_MOUSE_RELEASED not only when button1, button2 or button3 are pressed/released, but also when button4, button5, button6 and button7 are pressed/released.
Regarding vertical scoll we have no problems because in MouseEventCycle function (WindowCompositorX11.cpp), NUX_MOUSE_WHEEL has an higher priority then NUX_MOUSE_PRESSED, so the mouse_wheel signal is emitted.
As said in the preface nux doesn't support horizontal scroll. So NUX_MOUSE_WHEEL is not setted and in MouseEventCycle because NUX_MOUSE_PRESSED is setted, the mouse_click (or mouse_up) signal is emitted.
--------------------------
- Solution
--------------------------
Don't set NUX_MOUSE_PRESSED (or NUX_MOUSE_RELEASED) if it's a scroll.
---------------------------
- P.S.
---------------------------
No regressions found during my manual test. I cannot imagine any kind of regression. Please let me know if something is wrong.
. Fixes: . Reviewed by Jay Taoko.