Merge lp:~dandrader/unity-mir/osk_rotation_lp1236489 into lp:unity-mir

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Gerry Boland
Approved revision: 123
Merged at revision: 131
Proposed branch: lp:~dandrader/unity-mir/osk_rotation_lp1236489
Merge into: lp:unity-mir
Diff against target: 136 lines (+26/-49)
3 files modified
src/modules/Unity/Application/OSKController.qml (+5/-49)
src/modules/Unity/Application/ubuntukeyboardinfo.cpp (+11/-0)
src/modules/Unity/Application/ubuntukeyboardinfo.h (+10/-0)
To merge this branch: bzr merge lp:~dandrader/unity-mir/osk_rotation_lp1236489
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+190947@code.launchpad.net

Commit message

UbuntuKeyboardInfo now provides the opaque keybard area in scene coordinates

So all that's left for OSKController is setting its InputArea to match it.
No more guesswork anymore.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
123. By Daniel d'Andrada

UbuntuKeyboardInfo now provides the opaque keybard area in scene coordinates

So all that's left for OSKController is setting its InputArea to match it.
No more guesswork anymore!

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :
review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

Dependent approved, approving this too

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/modules/Unity/Application/OSKController.qml'
--- src/modules/Unity/Application/OSKController.qml 2013-10-09 21:03:57 +0000
+++ src/modules/Unity/Application/OSKController.qml 2013-10-14 18:42:48 +0000
@@ -48,61 +48,17 @@
48 anchors.fill: oskInputArea48 anchors.fill: oskInputArea
49 }49 }
5050
51 /* Need to position InputArea of oskSurface to cover the keyboard. But as shell51 /* Need to position InputArea of oskSurface to cover the keyboard. */
52 currently has no idea the shape of the OSK (since OSK draws inside a fullscreen
53 surface) we have to do guesswork so that the InputArea is correctly placed */
54 InputArea {52 InputArea {
55 id: oskInputArea53 id: oskInputArea
5654
57 readonly property int orientationAngle: Screen.angleBetween(Screen.primaryOrientation, Screen.orientation)55 x: ubuntuKeyboardInfo.x
56 y: ubuntuKeyboardInfo.y
57 width: ubuntuKeyboardInfo.width
58 height: ubuntuKeyboardInfo.height
5859
59 surface: __oskSurface60 surface: __oskSurface
60 enabled: false61 enabled: false
61
62 state: orientationAngle.toString()
63
64 states: [
65 State {
66 name: "0"
67 PropertyChanges { target: oskInputArea; height: ubuntuKeyboardInfo.height; width: undefined }
68 AnchorChanges { target: oskInputArea; anchors {
69 top: undefined
70 bottom: parent.bottom
71 left: parent.left
72 right: parent.right
73 }}
74 },
75 State {
76 name: "180"
77 PropertyChanges { target: oskInputArea; height: ubuntuKeyboardInfo.height; width: undefined }
78 AnchorChanges { target: oskInputArea; anchors {
79 top: parent.top
80 bottom: undefined
81 left: parent.left
82 right: parent.right
83 }}
84 },
85 State {
86 name: "270"
87 PropertyChanges { target: oskInputArea; height: undefined; width: ubuntuKeyboardInfo.height }
88 AnchorChanges { target: oskInputArea; anchors {
89 top: parent.top
90 bottom: parent.bottom
91 left: undefined
92 right: parent.right
93 }}
94 },
95 State {
96 name: "90"
97 PropertyChanges { target: oskInputArea; height: undefined; width: ubuntuKeyboardInfo.height }
98 AnchorChanges { target: oskInputArea; anchors {
99 top: parent.top
100 bottom: parent.bottom
101 left: parent.left
102 right: undefined
103 }}
104 }
105 ]
106 }62 }
10763
108 Connections {64 Connections {
10965
=== modified file 'src/modules/Unity/Application/ubuntukeyboardinfo.cpp'
--- src/modules/Unity/Application/ubuntukeyboardinfo.cpp 2013-10-14 10:30:36 +0000
+++ src/modules/Unity/Application/ubuntukeyboardinfo.cpp 2013-10-14 18:42:48 +0000
@@ -117,6 +117,17 @@
117117
118 {118 {
119 struct SharedInfo *sharedInfo = reinterpret_cast<struct SharedInfo*>(bytes.data());119 struct SharedInfo *sharedInfo = reinterpret_cast<struct SharedInfo*>(bytes.data());
120
121 if (m_lastX != sharedInfo->keyboardX) {
122 m_lastX = sharedInfo->keyboardX;
123 Q_EMIT xChanged(m_lastX);
124 }
125
126 if (m_lastY != sharedInfo->keyboardY) {
127 m_lastY = sharedInfo->keyboardY;
128 Q_EMIT yChanged(m_lastY);
129 }
130
120 if (m_lastWidth != sharedInfo->keyboardWidth) {131 if (m_lastWidth != sharedInfo->keyboardWidth) {
121 m_lastWidth = sharedInfo->keyboardWidth;132 m_lastWidth = sharedInfo->keyboardWidth;
122 Q_EMIT widthChanged(m_lastWidth);133 Q_EMIT widthChanged(m_lastWidth);
123134
=== modified file 'src/modules/Unity/Application/ubuntukeyboardinfo.h'
--- src/modules/Unity/Application/ubuntukeyboardinfo.h 2013-10-11 15:34:58 +0000
+++ src/modules/Unity/Application/ubuntukeyboardinfo.h 2013-10-14 18:42:48 +0000
@@ -25,15 +25,21 @@
25// instead of a fullscreen one.25// instead of a fullscreen one.
26class UbuntuKeyboardInfo : public QObject {26class UbuntuKeyboardInfo : public QObject {
27 Q_OBJECT27 Q_OBJECT
28 Q_PROPERTY(qreal x READ x NOTIFY xChanged)
29 Q_PROPERTY(qreal y READ y NOTIFY yChanged)
28 Q_PROPERTY(qreal width READ width NOTIFY widthChanged)30 Q_PROPERTY(qreal width READ width NOTIFY widthChanged)
29 Q_PROPERTY(qreal height READ height NOTIFY heightChanged)31 Q_PROPERTY(qreal height READ height NOTIFY heightChanged)
30public:32public:
31 UbuntuKeyboardInfo(QObject *parent = 0);33 UbuntuKeyboardInfo(QObject *parent = 0);
32 virtual ~UbuntuKeyboardInfo();34 virtual ~UbuntuKeyboardInfo();
35 qreal x() const { return m_lastX; }
36 qreal y() const { return m_lastY; }
33 qreal width() const { return m_lastWidth; }37 qreal width() const { return m_lastWidth; }
34 qreal height() const { return m_lastHeight; }38 qreal height() const { return m_lastHeight; }
3539
36Q_SIGNALS:40Q_SIGNALS:
41 void xChanged(qreal x);
42 void yChanged(qreal y);
37 void widthChanged(qreal width);43 void widthChanged(qreal width);
38 void heightChanged(qreal height);44 void heightChanged(qreal height);
3945
@@ -47,6 +53,8 @@
47 // NB! Must match the definition in ubuntu-keyboard. Not worth creating a shared header53 // NB! Must match the definition in ubuntu-keyboard. Not worth creating a shared header
48 // just for that.54 // just for that.
49 struct SharedInfo {55 struct SharedInfo {
56 qint32 keyboardX;
57 qint32 keyboardY;
50 qint32 keyboardWidth;58 qint32 keyboardWidth;
51 qint32 keyboardHeight;59 qint32 keyboardHeight;
52 };60 };
@@ -57,6 +65,8 @@
57 int m_consecutiveAttempts;65 int m_consecutiveAttempts;
5866
59 QLocalSocket m_socket;67 QLocalSocket m_socket;
68 qint32 m_lastX;
69 qint32 m_lastY;
60 qint32 m_lastWidth;70 qint32 m_lastWidth;
61 qint32 m_lastHeight;71 qint32 m_lastHeight;
62 QTimer m_connectionRetryTimer;72 QTimer m_connectionRetryTimer;

Subscribers

People subscribed via source and target branches