on xenial help sign in
MouseArea that shows the indicators panel should cover the indicators bar only

As the showDragHandle area is expanded when we are in fullscreen mode so that a top-edge swipe can be used to pull down the indicators. Fixes: #1439318 Approved by: Michael Zanetti

commit19c2852f874f5e8f16ca22d37fd2d8e158b6fa27 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateThu 9 Apr 2015, 14:00 (12 years ago) parentadb8c59a5781bd
3 files changed+58−1
qml/Panel/IndicatorsMenu.qml+5−1 qml/Panel/Panel.qml+1 tests/qmltests/Panel/tst_Panel.qml+52
qml/Panel/IndicatorsMenu.qml+5−1
@@ -88,6 +88,7 @@ Showable {
8888
8989 Handle {
9090 id: handle
91+ objectName: "handle"
9192 anchors {
9293 left: parent.left
9394 right: parent.right
@@ -163,7 +164,10 @@ Showable {
163164 }
164165
165166 MouseArea {
166− anchors.fill: __showDragHandle
167+ anchors.bottom: parent.bottom
168+ anchors.left: parent.left
169+ anchors.right: parent.right
170+ height: minimizedPanelHeight
167171 enabled: __showDragHandle.enabled
168172 onClicked: {
169173 bar.selectItemAt(mouseX)
qml/Panel/Panel.qml+1
@@ -187,6 +187,7 @@ Item {
187187
188188 QtObject {
189189 id: d
190+ objectName: "panelPriv"
190191 readonly property real indicatorHeight: indicators.minimizedPanelHeight + indicatorOrangeLine.height
191192 }
192193
tests/qmltests/Panel/tst_Panel.qml+52
@@ -390,5 +390,57 @@ IndicatorTest {
390390 tap(panel, touchPosX, touchPosY);
391391 compare(backgroundPressedSpy.count, 2);
392392 }
393+
394+ /*
395+ Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1439318
396+ When the panel is in fullscreen mode and the user taps near the top edge,
397+ the panel should take no action and the tap should reach the item behind the
398+ panel.
399+ */
400+ function test_tapNearTopEdgeWithPanelInFullscreenMode() {
401+ var indicatorArea = findChild(panel, "indicatorArea");
402+ verify(indicatorArea);
403+ var panelPriv = findInvisibleChild(panel, "panelPriv");
404+ verify(panelPriv);
405+
406+ panel.fullscreenMode = true;
407+ // wait until if finishes hiding itself
408+ tryCompare(indicatorArea, "y", -panelPriv.indicatorHeight);
409+
410+ compare(panel.indicators.shown, false);
411+ verify(panel.indicators.fullyClosed);
412+
413+ // tap near the very top of the screen
414+ tap(itemArea, itemArea.width / 2, 2);
415+
416+ // the tap should have reached the item behind the panel
417+ compare(backgroundPressedSpy.count, 2);
418+
419+ // give it a couple of event loop iterations for any animations etc to kick in
420+ wait(50);
421+
422+ compare(panel.indicators.shown, false);
423+ verify(panel.indicators.fullyClosed);
424+ }
425+
426+ function test_openAndClosePanelWithMouseClicks() {
427+ compare(panel.indicators.shown, false);
428+ verify(panel.indicators.fullyClosed);
429+
430+ mouseClick(panel.indicators,
431+ panel.indicators.width / 2,
432+ panel.indicators.minimizedPanelHeight / 2);
433+
434+ compare(panel.indicators.shown, true);
435+ tryCompare(panel.indicators, "fullyOpened", true);
436+
437+ var handle = findChild(panel.indicators, "handle");
438+ verify(handle);
439+
440+ mouseClick(handle);
441+
442+ compare(panel.indicators.shown, false);
443+ tryCompare(panel.indicators, "fullyClosed", true);
444+ }
393445 }
394446}