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

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 430
Merged at revision: 424
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-1451554
Merge into: lp:ubuntu-keyboard
Diff against target: 104 lines (+23/-6)
3 files modified
qml/keys/CharKey.qml (+4/-0)
qml/keys/PressArea.qml (+18/-5)
tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py (+1/-1)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-1451554
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+278468@code.launchpad.net

Commit message

Work around upstream QT bugs 41692 and 44370 which cause incorrect touch point events when using a mouse

Description of the change

Work around upstream QT bugs 41692 and 44370 which cause incorrect touch points event when using a mouse

To post a comment you must log in.
426. By Michael Sheldon

Fix tab mixed in with spaces

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

Fix failing oxide keyboard test

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

Fix support for swiping keyboard away

429. By Michael Sheldon

Fix flake8 failures

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

Fix double mouse click regression

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/keys/CharKey.qml'
2--- qml/keys/CharKey.qml 2015-03-19 15:51:49 +0000
3+++ qml/keys/CharKey.qml 2015-12-01 14:11:26 +0000
4@@ -208,6 +208,10 @@
5 }
6
7 onReleased: {
8+ // Work around QT bug: https://bugreports.qt.io/browse/QTBUG-44370
9+ if (invalidReleaseFromMouse) {
10+ return;
11+ }
12 if (overridePressArea) {
13 key.released();
14 return;
15
16=== modified file 'qml/keys/PressArea.qml'
17--- qml/keys/PressArea.qml 2015-07-24 14:42:03 +0000
18+++ qml/keys/PressArea.qml 2015-12-01 14:11:26 +0000
19@@ -20,22 +20,26 @@
20 MultiPointTouchArea is similar to the MouseArea
21 But to enable multiple PressAreas to be touched at the same time, this is based
22 on MultiPointTouchArea
23-
24- FIXME this compoment assumes, that only one finger touches this single area at
25- the same time.
26 */
27 MultiPointTouchArea {
28 id: root
29
30 /// Is true while the area is touched, and the finger did not yet lift
31 property bool pressed: false
32+ property bool ongoingTouch: false
33+ property bool invalidReleaseFromMouse: false
34 // Track whether we've swiped out of a key press to dismiss the keyboard
35 property bool swipedOut: false
36 property bool held: false
37 property alias mouseX: point.x
38 property alias mouseY: point.y
39+ // Keep track of the touch start position ourselves instead of using
40+ // point.startY, as this always reports 0 for mouse interaction
41+ // (https://bugreports.qt.io/browse/QTBUG-41692)
42+ property real startY
43
44 property bool acceptDoubleClick: false
45+ maximumTouchPoints: 1
46
47 /// Same as MouseArea pressAndHold()
48 signal pressAndHold()
49@@ -76,7 +80,7 @@
50 // This works around issues with devices with touch buttons
51 // below the screen preventing release events when swiped
52 // over
53- if(point.sceneY > fullScreenItem.height - units.gu(4) && point.y > point.startY + units.gu(8) && !held) {
54+ if(point.sceneY > fullScreenItem.height - units.gu(4) && point.y > startY + units.gu(8) && !held) {
55 maliit_input_method.hide();
56 }
57 } else {
58@@ -103,9 +107,12 @@
59 }
60
61 onPressed: {
62+ ongoingTouch = true;
63+ invalidReleaseFromMouse = false;
64 pressed = true;
65 held = false;
66 swipedOut = false;
67+ startY = point.y;
68 holdTimer.restart();
69
70 // We keep a global view of whether any other keys have been
71@@ -126,13 +133,19 @@
72 }
73
74 onReleased: {
75+ // Work around QT bug: https://bugreports.qt.io/browse/QTBUG-44370
76+ if(!ongoingTouch) {
77+ invalidReleaseFromMouse = true;
78+ return;
79+ }
80 // Allow the user to swipe away the keyboard
81- if (point.y > point.startY + units.gu(8) && !held) {
82+ if (point.y > startY + units.gu(8) && !held) {
83 maliit_input_method.hide();
84 } else {
85 bounceBackAnimation.from = keyboardSurface.y;
86 bounceBackAnimation.start();
87 }
88+ ongoingTouch = false;
89 pressed = false;
90 held = false;
91 holdTimer.stop();
92
93=== modified file 'tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py'
94--- tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-07-28 10:22:15 +0000
95+++ tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-12-01 14:11:26 +0000
96@@ -1181,7 +1181,7 @@
97 <html><body><div id='scroll' style='width: 100%;
98 height: 200%; position: absolute; background: green;
99 visibility: hidden;'></div><input id='input'
100- type='text'
101+ style='height: 50%; width: 100%' type='text'
102 onkeyup=\\\"if (event.keyCode == 13)
103 {document.getElementById('input').disabled=true;
104 document.getElementById('scroll').style.visibility=

Subscribers

People subscribed via source and target branches