Merge lp:~3v1n0/unity/alt+tab-scroll-wheel into lp:unity
Proposed by
Marco Trevisan (Treviño)
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | 2032 |
Merged at revision: | 2090 |
Proposed branch: | lp:~3v1n0/unity/alt+tab-scroll-wheel |
Merge into: | lp:unity |
Diff against target: |
277 lines (+137/-13) 4 files modified
plugins/unityshell/src/unityshell.cpp (+46/-8) plugins/unityshell/src/unityshell.h (+2/-1) tests/autopilot/autopilot/emulators/unity/switcher.py (+16/-3) tests/autopilot/autopilot/tests/test_switcher.py (+73/-1) |
To merge this branch: | bzr merge lp:~3v1n0/unity/alt+tab-scroll-wheel |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alex Launi (community) | Approve | ||
Thomi Richards (community) | Approve | ||
Review via email:
|
Description of the change
Partly fixes bug #824965 enabling scroll wheel on Alt+Tab to switch the active application.
To post a comment you must log in.
Looks good, but with a few things that need fixing.
1) The docstrings for next_icon_mouse and previous_icon_mouse should say: "icon" instead of "application".
2) If possible, we should use constsants to define the mouse buttons in unity. These must be defined in X somewhere?
3)Your tests need to be split up, like this:
107 + def test_switcher_ scroll_ next(self) : timeout_ setting( False) initiate( ) get_selection_ index() next_icon_ mouse() get_selection_ index() (start, NotEquals(0)) (end, Equals(start + 1))
108 + self.set_
109 + sleep(1)
110 +
111 + self.switcher.
112 + sleep(.2)
113 +
114 + start = self.switcher.
115 + self.switcher.
116 + sleep(.2)
117 +
118 + end = self.switcher.
119 + self.assertThat
120 + self.assertThat
121 +
def test_switcher_ ignores_ fast_wheel_ down_events( self): get_selection_ index() next_icon_ mouse() next_icon_ mouse() get_selection_ index() (end, Equals(start + 1)) terminate( )
122 + # Quickly repeatead events should be ignored (except the first)
123 + start = self.switcher.
124 + self.switcher.
125 + self.switcher.
126 + sleep(.2)
127 +
128 + end = self.switcher.
129 + self.assertThat
130 +
131 + self.switcher.
132 +
133 + def test_switcher_ scroll_ prev(self) : timeout_ setting( False) initiate( ) get_selection_ index() previous_ icon_mouse( ) get_selection_ index() (start, NotEquals(0)) (end, Equals(start - 1))
134 + self.set_
135 + sleep(1)
136 +
137 + self.switcher.
138 + sleep(.2)
139 +
140 + start = self.switcher.
141 + self.switcher.
142 + sleep(.2)
143 +
144 + end = self.switcher.
145 + self.assertThat
146 + self.assertThat
147 +
def test_switcher_ ignores_ fast_wheel_ down_events( self): get_selection_ index() previous_ icon_mouse( ) previous_ icon_mouse( ) get_selection_ index() (end, Equals(start - 1)) terminate( ) timeout_ setting( True)
148 + # Quickly repeatead events should be ignored (except the first)
149 + start = self.switcher.
150 + self.switcher.
151 + self.switcher.
152 + sleep(.2)
153 +
154 + end = self.switcher.
155 + self.assertThat
156 +
157 + self.switcher.
158 + self.set_
159 +