on xenial help sign in
Update state of indicators bar only when the user is actively dragging himself

Fixes race with timer causing bug 1457044 Fixes: #1457044 Approved by: Nick Dedekind

commitc9074a52f29c34f1f7db7603774206d2a78646f8 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 21 Jul 2015, 09:08 (11 years ago) parent4525682200d350
3 files changed+8−1
qml/Panel/IndicatorsMenu.qml+1−1 tests/autopilot/unity8/indicators/__init__.py+1 tests/qmltests/Panel/tst_IndicatorsMenu.qml+6
qml/Panel/IndicatorsMenu.qml+1−1
@@ -270,7 +270,7 @@ Showable {
270270 }
271271
272272 function updateState() {
273− if (!showAnimation.running && !hideAnimation.running) {
273+ if (!showAnimation.running && !hideAnimation.running && d.activeDragHandle) {
274274 if (unitProgress <= 0) {
275275 root.state = "initial";
276276 // lock indicator if we've been committed and aren't moving too much laterally or too fast up.
tests/autopilot/unity8/indicators/__init__.py+1
@@ -74,6 +74,7 @@ class Indicator():
7474 # XXX this should be implemented as a general horizontal swiping in
7575 # the toolkit custom proxy object. -- elopio - 2015-01-20
7676 if not flickable.atXEnd:
77+ flickable.interactive.wait_for(True)
7778 while not flickable.atXEnd:
7879 start_y = stop_y = (
7980 flickable.globalRect.y +
tests/qmltests/Panel/tst_IndicatorsMenu.qml+6
@@ -145,11 +145,17 @@ IndicatorTest {
145145 }
146146
147147 function test_progress_changes_state_to_reveal() {
148+ var firstItem = get_indicator_item(0);
149+ var firstItemMappedPosition = indicatorsMenu.mapFromItem(firstItem, firstItem.width/2, firstItem.height/2);
150+ touchPress(indicatorsMenu, firstItemMappedPosition.x, indicatorsMenu.minimizedPanelHeight / 2);
151+
148152 indicatorsMenu.height = indicatorsMenu.openedHeight / 2;
149153 compare(indicatorsMenu.state, "reveal", "Indicators should be revealing when partially opened.");
150154
151155 indicatorsMenu.height = indicatorsMenu.openedHeight;
152156 compare(indicatorsMenu.state, "reveal", "Indicators should still be revealing when fully opened.");
157+
158+ touchRelease(indicatorsMenu, firstItemMappedPosition.x, indicatorsMenu.minimizedPanelHeight / 2);
153159 }
154160
155161 function test_open_state() {