on xenial help sign in
Eat hover events when the launcher quicklist is open

This way we don't change the mouse cursor wrongly to resize windows for example

commit2896d09850288b73f0b755e1ce9dde78ddda4b36 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 31 Jan 2017, 15:30 (10 years ago) parent8a02dc2
3 files changed+27−1
qml/Launcher/Launcher.qml+2−1 qml/Launcher/LauncherPanel.qml+3 tests/qmltests/tst_Shell.qml+22
qml/Launcher/Launcher.qml+2−1
@@ -307,7 +307,8 @@ FocusScope {
307307 InverseMouseArea {
308308 id: closeMouseArea
309309 anchors.fill: panel
310− enabled: root.state == "visible" || root.state == "drawer"
310+ enabled: (root.state == "visible" && !root.lockedVisible) || root.state == "drawer" || hoverEnabled
311+ hoverEnabled: panel.quickListOpen
311312 visible: enabled
312313 onPressed: {
313314 mouse.accepted = false;
qml/Launcher/LauncherPanel.qml+3
@@ -35,6 +35,7 @@ Rectangle {
3535 || dndArea.containsMouse || dashItem.hovered
3636 property int highlightIndex: -2
3737 property bool shortcutHintsShown: false
38+ readonly property bool quickListOpen: quickList.state === "open"
3839
3940 signal applicationSelected(string appId)
4041 signal showDashHome()
@@ -686,6 +687,8 @@ Rectangle {
686687 InverseMouseArea {
687688 anchors.fill: quickListShape
688689 enabled: quickList.state == "open" || pressed
690+ hoverEnabled: enabled
691+ visible: enabled
689692
690693 onClicked: {
691694 quickList.state = "";
tests/qmltests/tst_Shell.qml+22
@@ -2779,5 +2779,27 @@ Rectangle {
27792779 }
27802780 tryCompareFunction(function() { return drawer.visible; }, false);
27812781 }
2782+
2783+ function test_launcherWindowResizeInteraction()
2784+ {
2785+ loadShell("desktop");
2786+ waitForRendering(shell)
2787+ shell.usageScenario = "desktop"
2788+ waitForRendering(shell)
2789+ swipeAwayGreeter();
2790+
2791+ var app1SurfaceId = topLevelSurfaceList.nextId;
2792+ var app1 = ApplicationManager.startApplication("dialer-app")
2793+ waitUntilAppWindowIsFullyLoaded(app1SurfaceId);
2794+
2795+ var launcherDelegate1 = findChild(shell, "launcherDelegate1");
2796+ mouseClick(launcherDelegate1, launcherDelegate1.width / 2, launcherDelegate1.height / 2, Qt.RightButton);
2797+
2798+ var appDelegate = findChild(shell, "appDelegate_" + app1SurfaceId);
2799+ mouseMove(shell, appDelegate.mapToItem(shell, 0, 0).x, launcherDelegate1.mapToItem(shell, 0, 0).y);
2800+
2801+ expectFail("", "Cursor should not change while launcher menu is open");
2802+ tryCompare(Mir, "cursorName", "left_side");
2803+ }
27822804 }
27832805}