Merge lp:~dandrader/unity/lp969554 into lp:unity

Proposed by Daniel d'Andrada
Status: Superseded
Proposed branch: lp:~dandrader/unity/lp969554
Merge into: lp:unity
Diff against target: 42 lines (+2/-7)
2 files modified
plugins/unityshell/src/GestureEngine.cpp (+2/-6)
plugins/unityshell/src/GestureEngine.h (+0/-1)
To merge this branch: bzr merge lp:~dandrader/unity/lp969554
Reviewer Review Type Date Requested Status
Thomi Richards (community) Needs Fixing
Review via email: mp+100232@code.launchpad.net

This proposal has been superseded by a proposal from 2012-04-04.

Description of the change

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Hi,

How can we test this? We need either a unit test, or an autopilot test, or, as a final resort, a manual test. From the looks of it, GestureEngine is going to be tricky to write a unit test for (it contains a lot of XLib calls, and is tightly coupled with CompScreen), but perhaps we can write an autopilot test? We'd need to work out how to simulate multi-touch using python & XLib.

...If that doesn't work, we need a manual test. Please consult the README and TEST_TEMPLATE files in manual-tests/ before writing one.

Thanks

review: Needs Fixing
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> How can we test this? We need either a unit test, or an autopilot test, or, as
> a final resort, a manual test.[...]

It now has a unit test, but it's built on top of the commits from lp:~dandrader/unity/lp940612 (merge proposal https://code.launchpad.net/~dandrader/unity/lp940612/+merge/99956)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/GestureEngine.cpp'
2--- plugins/unityshell/src/GestureEngine.cpp 2012-03-14 06:24:18 +0000
3+++ plugins/unityshell/src/GestureEngine.cpp 2012-03-30 20:02:20 +0000
4@@ -262,7 +262,6 @@
5 return;
6
7 _pinch_id = data->id;
8- _pinch_start_radius = data->radius;
9
10 if (_pinch_grab)
11 _screen->removeGrab(_pinch_grab, NULL);
12@@ -275,17 +274,14 @@
13 if (data->id != _pinch_id)
14 return;
15
16- float delta_radius = data->radius - _pinch_start_radius;
17- if (delta_radius > 110.0f)
18+ if (data->radius > 1.25)
19 {
20 _pinch_window->maximize(MAXIMIZE_STATE);
21- _pinch_start_radius = data->radius;
22 EndDrag();
23 }
24- else if (delta_radius < -110.0f)
25+ else if (data->radius < 0.8)
26 {
27 _pinch_window->maximize(0);
28- _pinch_start_radius = data->radius;
29 EndDrag();
30 }
31 }
32
33=== modified file 'plugins/unityshell/src/GestureEngine.h'
34--- plugins/unityshell/src/GestureEngine.h 2011-09-28 14:31:35 +0000
35+++ plugins/unityshell/src/GestureEngine.h 2012-03-30 20:02:20 +0000
36@@ -65,6 +65,5 @@
37 int _pinch_id;
38 int _touch_id;
39
40- float _pinch_start_radius;
41 Cursor _fleur_cursor;
42 };