on xenial help sign in
Re-enable disabled code for 5.9 transition (#40)

* Revert "[TMP] Support qt 5.9" This reverts commit 95d8efbee7f6d3c4ef7f1d091f36d64d2155fd80. * Update changelog * Override QQuickGeometryChange instead * Handle geometry changes using geometryChanged() rather than item" * Another instance of itemGeometryChanged * The "A-ha" moment * Remove use of invalid private member * Unbreak the things I just broke * Cast to int * Update header * Remove stray semicolon * Don't be so explicit * Nitpicking * Flush touch events using the new private flushFrameSynchronousEvents()

commit5aa12faa43f6a2fb1e8d0c68945feee3721010a5 authorDalton Durst <UniversalSuperBox@users.noreply.github.com> dateSat 2 Jun 2018, 19:20 (8 years ago) parent72f2ecf
14 files changed+26−33
debian/changelog+6 plugins/Dash/listviewwithpageheader.cpp+3−5 plugins/Dash/listviewwithpageheader.h+1−1 plugins/Dash/verticaljournal.cpp+6−8 plugins/Dash/verticaljournal.h+1−1 tests/plugins/CMakeLists.txt+1−1 tests/plugins/Ubuntu/CMakeLists.txt+1−1 tests/plugins/Ubuntu/Gestures/GestureTest.cpp+1−1 tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+1−1 tests/plugins/Utils/ModelTest.cpp+1−1 tests/qmltests/CMakeLists.txt+1−1 tests/qmltests/Components/tst_DragHandle.cpp+2−2 tests/utils/CMakeLists.txt+1−1 tests/utils/modules/Unity/Test/TouchEventSequenceWrapper.cpp−9
debian/changelog+6
@@ -1,3 +1,9 @@
1+unity8 (8.17+ubports2) xenial; urgency=medium
2+
3+ * Fix for https://github.com/ubports/ubuntu-touch/issues/624
4+
5+ -- Dalton Durst <dalton@ubports.com> Fri, 1 Jun 2018 16:14:11 -0500
6+
17unity8 (8.17+ubports1) UNRELEASED; urgency=medium
28
39 * No change rebuild to generate sources in ubports repo
plugins/Dash/listviewwithpageheader.cpp+3−5
@@ -1141,11 +1141,10 @@ void ListViewWithPageHeader::contentYAnimationRunningChanged(bool running)
11411141 }
11421142}
11431143
1144−/*
1145−void ListViewWithPageHeader::itemGeometryChanged(QQuickItem *item, const QRectF &newGeometry, const QRectF &oldGeometry)
1144+void ListViewWithPageHeader::itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry)
11461145{
1147− const qreal heightDiff = newGeometry.height() - oldGeometry.height();
1148− if (heightDiff != 0) {
1146+ if (change.heightChange()) {
1147+ const qreal heightDiff = height() - oldGeometry.height();
11491148 if (!m_visibleItems.isEmpty()) {
11501149 ListItem *firstItem = m_visibleItems.first();
11511150 const auto prevFirstItemY = firstItem->y();
@@ -1166,7 +1165,6 @@ void ListViewWithPageHeader::itemGeometryChanged(QQuickItem *item, const QRectF
11661165 m_contentHeightDirty = true;
11671166 }
11681167}
1169−*/
11701168
11711169void ListViewWithPageHeader::itemImplicitHeightChanged(QQuickItem *item)
11721170{
plugins/Dash/listviewwithpageheader.h+1−1
@@ -116,7 +116,7 @@ protected:
116116 void viewportMoved(Qt::Orientations orient) override;
117117 qreal minYExtent() const override;
118118 qreal maxYExtent() const override;
119− //void itemGeometryChanged(QQuickItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) override;
119+ void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) override;
120120 void itemImplicitHeightChanged(QQuickItem *item) override;
121121 void updatePolish() override;
122122
plugins/Dash/verticaljournal.cpp+6−8
@@ -271,11 +271,9 @@ void VerticalJournal::processModelRemoves(const QVector<QQmlChangeSet::Change> &
271271 }
272272}
273273
274−
275−//void VerticalJournal::itemGeometryChanged(QQuickItem * /*item*/, const QRectF &newGeometry, const QRectF &oldGeometry)
276−//{
277−// const qreal heightDiff = newGeometry.height() - oldGeometry.height();
278−// if (heightDiff != 0) {
279−// relayout();
280−// }
281−//}
274+void VerticalJournal::itemGeometryChanged(QQuickItem * /*item*/, QQuickGeometryChange change, const QRectF &)
275+{
276+ if (change.verticalChange()) {
277+ relayout();
278+ }
279+}
plugins/Dash/verticaljournal.h+1−1
@@ -66,7 +66,7 @@ public:
6666 void setColumnWidth(qreal columnWidth);
6767
6868protected:
69−// void itemGeometryChanged(QQuickItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) override;
69+ void itemGeometryChanged(QQuickItem * /*item*/, QQuickGeometryChange change, const QRectF &oldGeometry) override;
7070
7171Q_SIGNALS:
7272 void columnWidthChanged();
tests/plugins/CMakeLists.txt+1−1
@@ -8,5 +8,5 @@ add_subdirectory(LightDM)
88add_subdirectory(SessionBroadcast)
99add_subdirectory(Ubuntu)
1010add_subdirectory(Unity)
11−#add_subdirectory(Utils) #FIXME broken with qt 5.9
11+add_subdirectory(Utils)
1212add_subdirectory(Wizard)
tests/plugins/Ubuntu/CMakeLists.txt+1−1
@@ -1 +1 @@
1−#add_subdirectory(Gestures) #FIXME broken with qt 5.9
1+add_subdirectory(Gestures)
tests/plugins/Ubuntu/Gestures/GestureTest.cpp+1−1
@@ -107,7 +107,7 @@ void GestureTest::sendTouch(qint64 timestamp, int id, QPointF pos,
107107 QCoreApplication::sendEvent(m_view, &touchEvent);
108108
109109 QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(m_view);
110− windowPrivate->flushDelayedTouchEvent();
110+ windowPrivate->flushFrameSynchronousEvents();
111111}
112112
113113void GestureTest::passTime(qint64 timeSpanMs)
tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+1−1
@@ -189,7 +189,7 @@ void tst_TouchGate::holdsEventsUntilGainsOwnership()
189189 if (!ownershipAfterTouchEnd) {
190190 touchRegistry->removeCandidateOwnerForTouch(0, candidateItem);
191191 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(testItem->window());
192− wp->flushDelayedTouchEvent();
192+ wp->flushFrameSynchronousEvents();
193193 // TouchGate should now open its flood gates and let testItem get all
194194 // events from touch 0 produced so far
195195 QCOMPARE(testItem->touchEventsReceived.count(), 2);
tests/plugins/Utils/ModelTest.cpp+1−1
@@ -441,7 +441,7 @@ void ModelTest::data()
441441 QVariant textAlignmentVariant = model->data ( model->index ( 0, 0 ), Qt::TextAlignmentRole );
442442 if ( textAlignmentVariant.isValid() ) {
443443 int alignment = textAlignmentVariant.toInt();
444− QCOMPARE( alignment, ( alignment & ( Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask ) ) );
444+ QCOMPARE( alignment, (int) ( alignment & ( Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask ) ));
445445 }
446446
447447 // General Purpose roles that should return a QColor
tests/qmltests/CMakeLists.txt+1−1
@@ -1,5 +1,5 @@
11
2−#add_subdirectory(Components) #FIXME broken with qt 5.9
2+add_subdirectory(Components)
33
44add_unity8_qmltest(. OrientedShell)
55add_unity8_qmltest(. DisabledScreenNotice)
tests/qmltests/Components/tst_DragHandle.cpp+2−2
@@ -177,7 +177,7 @@ void tst_DragHandle::flickAndHold(QQuickItem *dragHandle,
177177 QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
178178
179179 QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(m_view);
180− windowPrivate->flushDelayedTouchEvent();
180+ windowPrivate->flushFrameSynchronousEvents();
181181}
182182
183183void tst_DragHandle::drag(QPointF &touchPoint, const QPointF& direction, qreal distance,
@@ -192,7 +192,7 @@ void tst_DragHandle::drag(QPointF &touchPoint, const QPointF& direction, qreal d
192192 m_fakeTimeSource->m_msecsSinceReference += timeStep;
193193 QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
194194
195− windowPrivate->flushDelayedTouchEvent();
195+ windowPrivate->flushFrameSynchronousEvents();
196196 }
197197}
198198
tests/utils/CMakeLists.txt+1−1
@@ -1 +1 @@
1−#add_subdirectory(modules) #FIXME broken with qt 5.9
1+add_subdirectory(modules)
tests/utils/modules/Unity/Test/TouchEventSequenceWrapper.cpp−9
@@ -26,16 +26,7 @@ TouchEventSequenceWrapper::TouchEventSequenceWrapper(QTest::QTouchEventSequence
2626
2727void TouchEventSequenceWrapper::commit(bool processEvents)
2828{
29− // Item might be deleted as a consequence of this event sequence being handled
30− // So store its window beforehand
31− QQuickWindow *window = m_item->window();
32−
3329 m_eventSequence.commit(processEvents);
34−
35− if (window) {
36− QQuickWindowPrivate *wp = QQuickWindowPrivate::get(window);
37− wp->flushDelayedTouchEvent();
38− }
3930}
4031
4132void TouchEventSequenceWrapper::move(int touchId, int x, int y)