Merge lp:~michael-sheldon/ubuntu-keyboard/fix-1477901 into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Michael Sheldon
Approved revision: 397
Merged at revision: 398
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-1477901
Merge into: lp:ubuntu-keyboard
Diff against target: 72 lines (+22/-7)
4 files modified
qml/KeyboardContainer.qml (+2/-0)
qml/keys/PressArea.qml (+14/-4)
tests/autopilot/ubuntu_keyboard/emulators/keyboard.py (+6/-1)
tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py (+0/-2)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-1477901
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+265839@code.launchpad.net

Commit message

Check that another key hasn't been pressed in between double click presses

Description of the change

Check that another key hasn't been pressed in between double click presses

To post a comment you must log in.
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ubuntu-keyboard) on device or emulator?

 * Yes

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed UI labels, did you update the pot file?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
396. By Michael Sheldon

Remove no longer necessary sleep workaround from test

397. By Michael Sheldon

Don't attempt to automatically switch to a requested state in keyboard tests if the test is manually pressing the shift key, as this will also change state.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

I can confirm this fixed the issue we had in ubuntu-system-settings, all keyboard related tests pass again.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/KeyboardContainer.qml'
2--- qml/KeyboardContainer.qml 2015-05-06 10:33:53 +0000
3+++ qml/KeyboardContainer.qml 2015-07-28 10:57:42 +0000
4@@ -36,6 +36,8 @@
5 property bool switchBack: false // Switch back to the previous layout when changing fields
6 property bool justChangedLanguage: true // Don't switch back languages during language switch process
7
8+ property Item lastKeyPressed // Used for determining double click validity in PressArea
9+
10 state: "CHARACTERS"
11
12 function closeExtendedKeys()
13
14=== modified file 'qml/keys/PressArea.qml'
15--- qml/keys/PressArea.qml 2014-10-20 17:31:39 +0000
16+++ qml/keys/PressArea.qml 2015-07-28 10:57:42 +0000
17@@ -107,11 +107,21 @@
18 held = false;
19 swipedOut = false;
20 holdTimer.restart();
21+
22+ // We keep a global view of whether any other keys have been
23+ // pressed in between the first tap on this key and the second
24+ // one, so that quickly tapping one key, then tapping another,
25+ // then tapping the first again doesn't trigger a double click.
26+
27 if (doubleClickTimer.running) {
28- doubleClicked();
29- }
30- if (acceptDoubleClick) {
31- doubleClickTimer.restart();
32+ if (panel.lastKeyPressed == root) {
33+ doubleClicked();
34+ }
35+ } else {
36+ if (acceptDoubleClick) {
37+ doubleClickTimer.restart();
38+ }
39+ panel.lastKeyPressed = root
40 }
41 }
42
43
44=== modified file 'tests/autopilot/ubuntu_keyboard/emulators/keyboard.py'
45--- tests/autopilot/ubuntu_keyboard/emulators/keyboard.py 2015-07-16 13:55:08 +0000
46+++ tests/autopilot/ubuntu_keyboard/emulators/keyboard.py 2015-07-28 10:57:42 +0000
47@@ -180,7 +180,12 @@
48
49 key_pos = self._get_key_pos_from_keypad(req_keypad, key)
50 self._show_keypad(req_keypad)
51- self._change_keypad_to_state(req_key_state)
52+
53+ # Don't attempt to automatically switch to a requested state if the
54+ # test is manually pressing the shift key, as this will also change
55+ # state.
56+ if key != "shift":
57+ self._change_keypad_to_state(req_key_state)
58
59 if slide_offset is not None:
60 self._select_extended_key(key_pos, slide_offset)
61
62=== modified file 'tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py'
63--- tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-07-16 13:55:08 +0000
64+++ tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-07-28 10:57:42 +0000
65@@ -389,8 +389,6 @@
66 self.addCleanup(keyboard.dismiss)
67
68 keyboard.type('abc')
69- # Bug lp:1229003 and lp:1229001
70- sleep(.2)
71 keyboard.press_key('shift')
72 keyboard.press_key('shift', True)
73

Subscribers

People subscribed via source and target branches