Merge lp:~zsombi/ubuntu-ui-toolkit/panel-ima-fix into lp:ubuntu-ui-toolkit

Proposed by Zsombor Egri
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 522
Merged at revision: 521
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/panel-ima-fix
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 57 lines (+15/-0)
2 files modified
modules/Ubuntu/Components/plugin/inversemouseareatype.cpp (+13/-0)
modules/Ubuntu/Components/plugin/inversemouseareatype.h (+2/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/panel-ima-fix
Reviewer Review Type Date Requested Status
Olivier Tilloy (community) Approve
PS Jenkins bot continuous-integration Approve
Tim Peeters Approve
Review via email: mp+166273@code.launchpad.net

Commit message

[inversemousearea] Default sensing area not set on the proper time.

To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote :

code looks good

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks good, and fixes the regression with the browser app.

Ideally there should be a test to guard against similar regressions in the future, but seeing that it’s almost EOD, let’s get this merged, and ensure that the test is added tomorrow.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/plugin/inversemouseareatype.cpp'
2--- modules/Ubuntu/Components/plugin/inversemouseareatype.cpp 2013-05-24 11:11:31 +0000
3+++ modules/Ubuntu/Components/plugin/inversemouseareatype.cpp 2013-05-29 14:50:39 +0000
4@@ -83,6 +83,7 @@
5 */
6 InverseMouseAreaType::InverseMouseAreaType(QQuickItem *parent) :
7 QQuickItem(parent),
8+ m_ready(false),
9 m_pressed(false),
10 m_moved(false),
11 m_propagateEvents(false),
12@@ -118,6 +119,9 @@
13 */
14 void InverseMouseAreaType::update()
15 {
16+ if (!m_ready) {
17+ return;
18+ }
19 // update sensing area
20 if (!m_sensingArea)
21 m_sensingArea = QuickUtils::instance().rootItem(this);
22@@ -125,6 +129,15 @@
23 reset();
24 }
25
26+void InverseMouseAreaType::componentComplete()
27+{
28+ QQuickItem::componentComplete();
29+ // by now the parents shoudl have been resolved so we can look after the
30+ // topmost component for the sensingArea in case it has not been set yet
31+ m_ready = true;
32+ update();
33+}
34+
35 /*!
36 \qmlproperty bool InverseMouseArea::pressed
37 This property holds whether the acceptedButtons are pressed outside the area or not.
38
39=== modified file 'modules/Ubuntu/Components/plugin/inversemouseareatype.h'
40--- modules/Ubuntu/Components/plugin/inversemouseareatype.h 2013-04-15 08:39:51 +0000
41+++ modules/Ubuntu/Components/plugin/inversemouseareatype.h 2013-05-29 14:50:39 +0000
42@@ -38,6 +38,7 @@
43
44 protected:
45 bool eventFilter(QObject *obj, QEvent *ev);
46+ void componentComplete();
47
48 private: // getter/setter
49 bool pressed() const;
50@@ -76,6 +77,7 @@
51 void update();
52
53 private:
54+ bool m_ready;
55 bool m_pressed;
56 bool m_moved;
57 bool m_propagateEvents;

Subscribers

People subscribed via source and target branches

to status/vote changes: