Merge lp:~aacid/unity8/lvwph_bad_header_position_1240118 into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Nick Dedekind
Approved revision: 485
Merged at revision: 527
Proposed branch: lp:~aacid/unity8/lvwph_bad_header_position_1240118
Merge into: lp:unity8
Diff against target: 70 lines (+22/-1)
3 files modified
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp (+4/-1)
plugins/ListViewWithPageHeader/listviewwithpageheader.h (+1/-0)
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertest.cpp (+17/-0)
To merge this branch: bzr merge lp:~aacid/unity8/lvwph_bad_header_position_1240118
Reviewer Review Type Date Requested Status
Nick Dedekind (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Michal Hruby (community) Approve
Review via email: mp+193200@code.launchpad.net

Commit message

LVWPH: Fix header going bad when setContentHeight ends up moving the viewport

How to reproduce the bug easily without the patch:
 * In the Dash Home, search for london
 * Scroll to the bottom
 * Start moving to the apps scope very slowly
 * At around 3/4 of the move you'll see the header in the home scope went to a bad position
 * Go back to the Dash Home

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:482
http://jenkins.qa.ubuntu.com/job/unity8-ci/1521/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/187
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/181/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/48
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/45
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/45
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/45/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/45
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/176
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/187
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/187/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/181
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/181/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2804/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2855
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/648
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/647

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1521/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

Fixes the incorrect positioning for me, although the code looks a bit fragile :)

review: Approve
483. By Albert Astals Cid

Merge lp:unity8

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
484. By Albert Astals Cid

booo

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
485. By Albert Astals Cid

Enable the check later?

I'm pretty convinced it's unstability has to do with the non great qml engine loop in 5.0

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

Ok, don't really understand the code, but it fixes the issue.
Test successfully tests for regressions.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/ListViewWithPageHeader/listviewwithpageheader.cpp'
--- plugins/ListViewWithPageHeader/listviewwithpageheader.cpp 2013-10-03 11:48:24 +0000
+++ plugins/ListViewWithPageHeader/listviewwithpageheader.cpp 2013-11-04 12:34:19 +0000
@@ -155,6 +155,7 @@
155 , m_topSectionItem(nullptr)155 , m_topSectionItem(nullptr)
156 , m_forceNoClip(false)156 , m_forceNoClip(false)
157 , m_inLayout(false)157 , m_inLayout(false)
158 , m_inContentHeightKeepHeaderShown(false)
158{159{
159 m_clipItem = new QQuickItem(contentItem());160 m_clipItem = new QQuickItem(contentItem());
160// m_clipItem = new QQuickRectangle(contentItem());161// m_clipItem = new QQuickRectangle(contentItem());
@@ -494,7 +495,7 @@
494 if (!scrolledUp && contentY() == -m_minYExtent) {495 if (!scrolledUp && contentY() == -m_minYExtent) {
495 m_headerItemShownHeight = 0;496 m_headerItemShownHeight = 0;
496 m_headerItem->setY(contentY());497 m_headerItem->setY(contentY());
497 } else if ((scrolledUp && notRebounding && notShownByItsOwn && !maximizeVisibleAreaRunning) || (m_headerItemShownHeight > 0)) {498 } else if ((scrolledUp && notRebounding && notShownByItsOwn && !maximizeVisibleAreaRunning) || (m_headerItemShownHeight > 0) || m_inContentHeightKeepHeaderShown) {
498 if (maximizeVisibleAreaRunning && diff > 0) // If we are maximizing and the header was shown, make sure we hide it499 if (maximizeVisibleAreaRunning && diff > 0) // If we are maximizing and the header was shown, make sure we hide it
499 m_headerItemShownHeight -= diff;500 m_headerItemShownHeight -= diff;
500 else501 else
@@ -1267,7 +1268,9 @@
12671268
1268 m_contentHeightDirty = false;1269 m_contentHeightDirty = false;
1269 adjustMinYExtent();1270 adjustMinYExtent();
1271 m_inContentHeightKeepHeaderShown = m_headerItem && m_headerItem->y() == contentY();
1270 setContentHeight(contentHeight);1272 setContentHeight(contentHeight);
1273 m_inContentHeightKeepHeaderShown = false;
1271 }1274 }
1272}1275}
12731276
12741277
=== modified file 'plugins/ListViewWithPageHeader/listviewwithpageheader.h'
--- plugins/ListViewWithPageHeader/listviewwithpageheader.h 2013-09-02 13:22:33 +0000
+++ plugins/ListViewWithPageHeader/listviewwithpageheader.h 2013-11-04 12:34:19 +0000
@@ -202,6 +202,7 @@
202202
203 bool m_forceNoClip;203 bool m_forceNoClip;
204 bool m_inLayout;204 bool m_inLayout;
205 bool m_inContentHeightKeepHeaderShown;
205206
206 // Qt 5.0 doesn't like releasing the items just after itemCreated207 // Qt 5.0 doesn't like releasing the items just after itemCreated
207 // so we delay the releasing until the next updatePolish208 // so we delay the releasing until the next updatePolish
208209
=== modified file 'tests/plugins/ListViewWithPageHeader/listviewwithpageheadertest.cpp'
--- tests/plugins/ListViewWithPageHeader/listviewwithpageheadertest.cpp 2013-10-02 13:20:56 +0000
+++ tests/plugins/ListViewWithPageHeader/listviewwithpageheadertest.cpp 2013-11-04 12:34:19 +0000
@@ -1824,6 +1824,23 @@
1824 lvwph->positionAtBeginning();1824 lvwph->positionAtBeginning();
1825 }1825 }
18261826
1827 void testHeaderPositionBug1240118()
1828 {
1829 scrollToBottom();
1830 lvwph->showHeader();
1831 QTRY_VERIFY(!lvwph->m_contentYAnimation->isRunning());
1832 QTest::qWait(100); // Make sure stuff is stable
1833 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 100));
1834 model->setProperty(3, "size", 10);
1835 model->setProperty(4, "size", 10);
1836 model->setProperty(5, "size", 10);
1837 model->setProperty(6, "size", 10);
1838#if (QT_VERSION > QT_VERSION_CHECK(5, 0, 3))
1839 QTRY_COMPARE(lvwph->m_minYExtent, 210.);
1840#endif
1841 QTRY_COMPARE(lvwph->m_headerItem->y(), -lvwph->m_minYExtent);
1842 }
1843
1827private:1844private:
1828 QQuickView *view;1845 QQuickView *view;
1829 ListViewWithPageHeader *lvwph;1846 ListViewWithPageHeader *lvwph;

Subscribers

People subscribed via source and target branches